From fd83572e9a4c1f01d2008ed5217dbe865e594ba9 Mon Sep 17 00:00:00 2001 From: Manan Tank Date: Fri, 25 Apr 2025 03:56:20 +0530 Subject: [PATCH] SDK: Signature screen loading state improvements --- .changeset/fast-bushes-juggle.md | 5 +++++ packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts | 1 + .../src/react/web/ui/ConnectWallet/ConnectButton.tsx | 2 +- .../react/web/ui/ConnectWallet/screens/SignatureScreen.tsx | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/fast-bushes-juggle.md diff --git a/.changeset/fast-bushes-juggle.md b/.changeset/fast-bushes-juggle.md new file mode 100644 index 00000000000..c439d9148ac --- /dev/null +++ b/.changeset/fast-bushes-juggle.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Signature Screen loading state improvements diff --git a/packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts b/packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts index c073edf385a..2a7516820c1 100644 --- a/packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts +++ b/packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts @@ -148,5 +148,6 @@ export function useSiweAuth( // checking if logged in isLoggedIn: isLoggedInQuery.data, isLoading: isLoggedInQuery.isFetching, + isPending: isLoggedInQuery.isPending, }; } diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx index 8adcb702e06..0a54aeb85f6 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx @@ -479,7 +479,7 @@ function ConnectButtonInner( if (siweAuth.requiresAuth) { // loading state if loading // TODO: figure out a way to consolidate the loading states with the ones from locale loading - if (siweAuth.isLoading || siweAuth.isLoggingIn || siweAuth.isLoggingOut) { + if (siweAuth.isPending || siweAuth.isLoggingIn || siweAuth.isLoggingOut) { const combinedClassName = `${props.connectButton?.className || ""} ${TW_CONNECT_WALLET}`; return ( ; }