From c95c0dc5bd1a48dab2cfab02d967a1d5ad0f711c Mon Sep 17 00:00:00 2001 From: MananTank Date: Fri, 6 Jun 2025 00:45:26 +0000 Subject: [PATCH] Nebula: Fix AutoConnect not using nebula client in root layout (#7291) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR focuses on updating the `TWAutoConnect` component to accept a `client` prop, allowing for better integration with different third-party clients in the application. ### Detailed summary - Updated `TWAutoConnect` in `layout.tsx` to accept a `client` prop. - Introduced `thirdwebClient` in `providers.tsx` to provide the client to `TWAutoConnect`. - Modified `TWAutoConnect` component to require a `client` prop. - Updated usage of `TWAutoConnect` in `nebula-app/providers.tsx` to pass in `nebulaAppThirdwebClient`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` ## Summary by CodeRabbit - **New Features** - Improved integration of client context within the auto-connect wallet feature, enhancing authentication and connectivity for users. - **Refactor** - Updated internal handling of client instances for wallet auto-connect components to streamline authentication processes. --- apps/dashboard/src/app/(app)/account/layout.tsx | 2 +- apps/dashboard/src/app/(app)/components/autoconnect.tsx | 7 +++---- apps/dashboard/src/app/(app)/providers.tsx | 3 ++- apps/dashboard/src/app/nebula-app/providers.tsx | 6 +++++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/dashboard/src/app/(app)/account/layout.tsx b/apps/dashboard/src/app/(app)/account/layout.tsx index 9021b15631a..e499dda12a3 100644 --- a/apps/dashboard/src/app/(app)/account/layout.tsx +++ b/apps/dashboard/src/app/(app)/account/layout.tsx @@ -46,7 +46,7 @@ export default async function AccountLayout(props: { /> {props.children} - + ); diff --git a/apps/dashboard/src/app/(app)/components/autoconnect.tsx b/apps/dashboard/src/app/(app)/components/autoconnect.tsx index c94e616321e..fa86400d5ed 100644 --- a/apps/dashboard/src/app/(app)/components/autoconnect.tsx +++ b/apps/dashboard/src/app/(app)/components/autoconnect.tsx @@ -1,16 +1,15 @@ "use client"; -import { getClientThirdwebClient } from "@/constants/thirdweb-client.client"; +import type { ThirdwebClient } from "thirdweb"; import { AutoConnect } from "thirdweb/react"; import type { SmartWalletOptions } from "thirdweb/wallets"; -const client = getClientThirdwebClient(); - export function TWAutoConnect(props: { accountAbstraction?: SmartWalletOptions; + client: ThirdwebClient; }) { return ( ); diff --git a/apps/dashboard/src/app/(app)/providers.tsx b/apps/dashboard/src/app/(app)/providers.tsx index 00879438746..e7b9cba9328 100644 --- a/apps/dashboard/src/app/(app)/providers.tsx +++ b/apps/dashboard/src/app/(app)/providers.tsx @@ -18,6 +18,7 @@ import { import { TWAutoConnect } from "./components/autoconnect"; const queryClient = new QueryClient(); +const thirdwebClient = getClientThirdwebClient(); export function AppRouterProviders(props: { children: React.ReactNode }) { return ( @@ -26,7 +27,7 @@ export function AppRouterProviders(props: { children: React.ReactNode }) { - + - +