11import React , { useMemo } from 'react' ;
22import { GetServerSideProps } from 'next'
33import MDX from '@mdx-js/runtime' ;
4- import App from '../components/app' ;
4+ import App , { AppProps as IApp } from '../components/app' ;
55import Grid from '../components/grid' ;
66import useForceHttps , { ForceHttpsStatus , replaceUrlWithHttps } from '../force-https' ;
77import { getContainersWithLabels , AppProps } from '../docker' ;
@@ -51,13 +51,15 @@ const Style : React.FC<{ colors : Colors }> = ({ colors }) => {
5151
5252const Home : React . FC < Props > = ( { colors, mdx, appData, forceHttps } ) => {
5353 const httpStatus = useForceHttps ( forceHttps ) ;
54- const apps = useMemo ( ( ) => {
55- return ( appData || [ ] ) . map ( ( {
54+ let apps : IApp [ ] = [ ] ;
55+
56+ if ( typeof window !== 'undefined' ) {
57+ apps = ( appData || [ ] ) . map ( ( {
5658 relativeSubdomain,
5759 url,
5860 ...app
5961 } ) => {
60- const href = ( relativeSubdomain && typeof window !== 'undefined' )
62+ const href = relativeSubdomain
6163 ? `//${ relativeSubdomain } .${ window . location . host } /`
6264 : ( url || "" ) ;
6365
@@ -67,7 +69,7 @@ const Home : React.FC<Props> = ({ colors, mdx, appData, forceHttps }) => {
6769
6870 return { ...app , href } ;
6971 } ) ;
70- } , [ appData , httpStatus ] ) ;
72+ }
7173
7274 return < >
7375 < Style colors = { colors } />
0 commit comments