Skip to content

Commit 3585ebf

Browse files
committed
[TOOL-5047] Fix client object missing teamId on contract publish page
1 parent 9546b92 commit 3585ebf

File tree

1 file changed

+6
-5
lines changed
  • apps/dashboard/src/app/(app)/(dashboard)/contracts/publish/[publish_uri]

1 file changed

+6
-5
lines changed

apps/dashboard/src/app/(app)/(dashboard)/contracts/publish/[publish_uri]/page.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { ChakraProviderSetup } from "chakra/ChakraProviderSetup";
22
import { revalidatePath } from "next/cache";
33
import { notFound, redirect } from "next/navigation";
44
import { fetchDeployMetadata } from "thirdweb/contract";
5+
import { getUserThirdwebClient } from "@/api/auth-token";
56
import { ContractPublishForm } from "@/components/contract-components/contract-publish-form";
67
import { getActiveAccountCookie, getJWTCookie } from "@/constants/cookie";
7-
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
88
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
99
import { getLatestPublishedContractsWithPublisherMapping } from "../../../published-contract/[publisher]/[contract_id]/utils/getPublishedContractsWithPublisherMapping";
1010

@@ -68,14 +68,15 @@ export default async function PublishContractPage(
6868
redirect(`/login?next=${encodeURIComponent(pathname)}`);
6969
}
7070

71+
const userThirdwebClient = await getUserThirdwebClient({
72+
teamId: undefined,
73+
});
74+
7175
return (
7276
<div className="container flex max-w-[1130px] flex-col gap-8 py-8">
7377
<ChakraProviderSetup>
7478
<ContractPublishForm
75-
client={getClientThirdwebClient({
76-
jwt: token,
77-
teamId: undefined,
78-
})}
79+
client={userThirdwebClient}
7980
isLoggedIn={!!token}
8081
onPublishSuccess={async () => {
8182
"use server";

0 commit comments

Comments
 (0)