diff --git a/pages/[chain]/index.tsx b/pages/[chain]/index.tsx index af6c9ca07..d390945f0 100644 --- a/pages/[chain]/index.tsx +++ b/pages/[chain]/index.tsx @@ -11,7 +11,7 @@ import Layout from 'components/Layout' import { paths } from '@reservoir0x/reservoir-sdk' import { useContext, useEffect, useState } from 'react' import { Footer } from 'components/home/Footer' -import { useMarketplaceChain } from 'hooks' +import { useMarketplaceChain, useMounted } from 'hooks' import supportedChains, { DefaultChain } from 'utils/chains' import { Head } from 'components/Head' import { ChainContext } from 'context/ChainContextProvider' @@ -32,6 +32,7 @@ const StyledImage = styled('img', {}) const Home: NextPage = ({ ssr }) => { const router = useRouter() const marketplaceChain = useMarketplaceChain() + const isMounted = useMounted() // not sure if there is a better way to fix this const { theme: nextTheme } = useTheme() @@ -58,7 +59,7 @@ const Home: NextPage = ({ ssr }) => { ? ssr.topSellingCollections[marketplaceChain.id] : null, }, - chain?.id + isMounted ? chain?.id : undefined, ) const topCollection = topSellingCollectionsData?.collections?.[0] diff --git a/pages/portfolio/[[...address]].tsx b/pages/portfolio/[[...address]].tsx index 7d0c53297..cf4d8228d 100644 --- a/pages/portfolio/[[...address]].tsx +++ b/pages/portfolio/[[...address]].tsx @@ -97,7 +97,7 @@ const IndexPage: NextPage = () => { data: collections, isLoading: collectionsLoading, fetchNextPage, - } = useUserCollections(address as string, collectionQuery) + } = useUserCollections(isMounted ? (address as string) : '', collectionQuery) // Batch listing logic const [showListingPage, setShowListingPage] = useState(false)