Skip to content

Commit 495c7f9

Browse files
committed
[TOOL-5047] Dashboard: Fix client object missing teamId on contract publish page (#7628)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## 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}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 32add5f commit 495c7f9

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)