Skip to content

Commit e446389

Browse files
committed
no crosschain prompt
1 parent f08d060 commit e446389

File tree

2 files changed

+30
-17
lines changed

2 files changed

+30
-17
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Link from "next/link";
2+
3+
export function NoCrossChainPrompt() {
4+
return (
5+
<div>
6+
Multi-chain deployments are not available for this contract. Deploy a
7+
new contract to enable this functionality.
8+
<br />
9+
<br />
10+
<Link href="/explore" target="_blank" className="text-blue-500 underline">
11+
Explore contracts
12+
</Link>
13+
</div>
14+
);
15+
}

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/cross-chain/page.tsx

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { type AbiFunction, decodeFunctionData } from "thirdweb/utils";
2222
import { getContractPageParamsInfo } from "../_utils/getContractFromParams";
2323
import { getContractPageMetadata } from "../_utils/getContractPageMetadata";
2424
import { DataTable } from "./data-table";
25+
import { NoCrossChainPrompt } from "./no-crosschain-prompt";
2526

2627
export function getModuleInstallParams(mod: FetchDeployMetadataResult) {
2728
return (
@@ -161,12 +162,19 @@ export default async function Page(props: {
161162
)
162163
).filter((c) => c.status === "DEPLOYED");
163164

164-
const coreMetadata = (
165-
await fetchPublishedContractsFromDeploy({
166-
contract,
167-
client: contract.client,
168-
})
169-
).at(-1) as FetchDeployMetadataResult;
165+
let coreMetadata;
166+
try {
167+
coreMetadata = (
168+
await fetchPublishedContractsFromDeploy({
169+
contract,
170+
client: contract.client,
171+
})
172+
).at(-1) as FetchDeployMetadataResult;
173+
} catch {}
174+
175+
if(!coreMetadata) {
176+
return NoCrossChainPrompt();
177+
}
170178

171179
let modulesMetadata: FetchDeployMetadataResult[] | undefined;
172180

@@ -240,17 +248,7 @@ export default async function Page(props: {
240248
}
241249

242250
if (!isDirectDeploy && !initializeData) {
243-
return (
244-
<div>
245-
Multi-chain deployments are not available for this contract. Deploy a
246-
new contract to enable this functionality.
247-
<br />
248-
<br />
249-
<Link href="/explore" target="_blank">
250-
Explore contracts
251-
</Link>
252-
</div>
253-
);
251+
return NoCrossChainPrompt();
254252
}
255253

256254
return (

0 commit comments

Comments
 (0)