File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/thirdweb/src/react/web/ui/ConnectWallet Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import { LockIcon } from "./icons/LockIcon.js";
3030import { useConnectLocale } from "./locale/getConnectLocale.js" ;
3131import type { ConnectLocale } from "./locale/types.js" ;
3232import { SignatureScreen } from "./screens/SignatureScreen.js" ;
33+ import { useAdminWallet } from "src/exports/react.native.js" ;
3334
3435const TW_CONNECT_WALLET = "tw-connect-wallet" ;
3536
@@ -400,6 +401,7 @@ function ConnectButtonInner(
400401) {
401402 const activeWallet = useActiveWallet ( ) ;
402403 const activeAccount = useActiveAccount ( ) ;
404+ const adminWallet = useAdminWallet ( ) ;
403405 const siweAuth = useSiweAuth ( activeWallet , activeAccount , props . auth ) ;
404406 const [ showSignatureModal , setShowSignatureModal ] = useState ( false ) ;
405407
@@ -410,13 +412,15 @@ function ConnectButtonInner(
410412 }
411413 } , [ activeAccount ] ) ;
412414
413- // if the wallet is connected and auth is required, trigger a login attempt automatically
415+ // if an IAW wallet is connected and auth is required, trigger a login attempt automatically
414416 useEffect ( ( ) => {
417+ const isIAW = activeWallet ?. id === "inApp" || adminWallet ?. id === "inApp" ;
415418 if (
416419 activeAccount &&
417420 siweAuth . requiresAuth &&
418421 ! siweAuth . isLoggedIn &&
419- ! siweAuth . isLoggingIn
422+ ! siweAuth . isLoggingIn &&
423+ isIAW
420424 ) {
421425 siweAuth . doLogin ( ) ;
422426 }
@@ -426,6 +430,8 @@ function ConnectButtonInner(
426430 siweAuth . doLogin ,
427431 siweAuth . isLoggedIn ,
428432 siweAuth . isLoggingIn ,
433+ activeWallet ,
434+ adminWallet ,
429435 ] ) ;
430436
431437 const theme = props . theme || "dark" ;
You can’t perform that action at this time.
0 commit comments