From 495c7f925db797d86374b654a2411f85a455972e Mon Sep 17 00:00:00 2001 From: MananTank Date: Tue, 15 Jul 2025 20:09:58 +0000 Subject: [PATCH] [TOOL-5047] Dashboard: Fix client object missing teamId on contract publish page (#7628) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR focuses on updating the `PublishContractPage` component to utilize the `getUserThirdwebClient` function for client initialization, enhancing user authentication handling during contract publishing. ### Detailed summary - Added import for `getUserThirdwebClient` from `@/api/auth-token`. - Removed import for `getClientThirdwebClient` from `@/constants/thirdweb-client.client`. - Replaced the client initialization in `ContractPublishForm` with `userThirdwebClient` from `getUserThirdwebClient`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` ## Summary by CodeRabbit * **Refactor** * Updated the way the client is obtained for the contract publish form, improving consistency in client retrieval. No visible changes to user experience. --- .../contracts/publish/[publish_uri]/page.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/dashboard/src/app/(app)/(dashboard)/contracts/publish/[publish_uri]/page.tsx b/apps/dashboard/src/app/(app)/(dashboard)/contracts/publish/[publish_uri]/page.tsx index e945cc99c8d..a70c71652f2 100644 --- a/apps/dashboard/src/app/(app)/(dashboard)/contracts/publish/[publish_uri]/page.tsx +++ b/apps/dashboard/src/app/(app)/(dashboard)/contracts/publish/[publish_uri]/page.tsx @@ -2,9 +2,9 @@ import { ChakraProviderSetup } from "chakra/ChakraProviderSetup"; import { revalidatePath } from "next/cache"; import { notFound, redirect } from "next/navigation"; import { fetchDeployMetadata } from "thirdweb/contract"; +import { getUserThirdwebClient } from "@/api/auth-token"; import { ContractPublishForm } from "@/components/contract-components/contract-publish-form"; import { getActiveAccountCookie, getJWTCookie } from "@/constants/cookie"; -import { getClientThirdwebClient } from "@/constants/thirdweb-client.client"; import { serverThirdwebClient } from "@/constants/thirdweb-client.server"; import { getLatestPublishedContractsWithPublisherMapping } from "../../../published-contract/[publisher]/[contract_id]/utils/getPublishedContractsWithPublisherMapping"; @@ -68,14 +68,15 @@ export default async function PublishContractPage( redirect(`/login?next=${encodeURIComponent(pathname)}`); } + const userThirdwebClient = await getUserThirdwebClient({ + teamId: undefined, + }); + return (
{ "use server";