File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress] Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ import { SidebarLayout } from "@/components/blocks/SidebarLayout";
33import { ContractMetadata } from "components/custom-contract/contract-header/contract-metadata" ;
44import { DeprecatedAlert } from "components/shared/DeprecatedAlert" ;
55import type { Metadata } from "next" ;
6+ import { notFound } from "next/navigation" ;
67import { getContractMetadata } from "thirdweb/extensions/common" ;
8+ import { isContractDeployed } from "thirdweb/utils" ;
79import { resolveFunctionSelectors } from "../../../../../lib/selectors" ;
810import { shortenIfAddress } from "../../../../../utils/usedapp-external" ;
911import { ConfigureCustomChain } from "./ConfigureCustomChain" ;
@@ -26,6 +28,13 @@ export default async function Layout(props: {
2628 return < ConfigureCustomChain chainSlug = { props . params . chain_id } /> ;
2729 }
2830
31+ // check if the contract exists
32+ const isValidContract = await isContractDeployed ( info . contract ) ;
33+ if ( ! isValidContract ) {
34+ // TODO - replace 404 with a better page to upsale deploy or other thirdweb products
35+ notFound ( ) ;
36+ }
37+
2938 const { contract, chainMetadata } = info ;
3039 const contractPageMetadata = await getContractPageMetadata ( contract ) ;
3140 const sidebarLinks = getContractPageSidebarLinks ( {
Original file line number Diff line number Diff line change 11import { PublishedBy } from "components/contract-components/shared/published-by" ;
2+ import { ErrorBoundary } from "react-error-boundary" ;
23import type { ThirdwebContract } from "thirdweb" ;
34import { AnalyticsOverview } from "./components/Analytics" ;
45import { BuildYourApp } from "./components/BuildYourApp" ;
@@ -99,7 +100,9 @@ export const ContractOverviewPage: React.FC<ContractOverviewPageProps> = ({
99100 />
100101 </ div >
101102 < div className = "shrink-0 lg:w-[300px]" >
102- < PublishedBy contract = { contract } />
103+ < ErrorBoundary fallback = { null } >
104+ < PublishedBy contract = { contract } />
105+ </ ErrorBoundary >
103106 </ div >
104107 </ div >
105108 ) ;
You can’t perform that action at this time.
0 commit comments