@@ -7,6 +7,7 @@ import { isEcosystemWallet } from "../../../../../wallets/ecosystem/is-ecosystem
77import type { Wallet } from "../../../../../wallets/interfaces/wallet.js" ;
88import type { EcosystemWalletId } from "../../../../../wallets/wallet-types.js" ;
99import { iconSize } from "../../../../core/design-system/index.js" ;
10+ import { useActiveWallet } from "../../../../core/hooks/wallets/useActiveWallet.js" ;
1011import { useActiveWalletChain } from "../../../../core/hooks/wallets/useActiveWalletChain.js" ;
1112import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminWallet.js" ;
1213import EcosystemWalletConnectUI from "../../../wallets/ecosystem/EcosystemWalletConnectUI.js" ;
@@ -28,20 +29,23 @@ export function LinkProfileScreen(props: {
2829 client : ThirdwebClient ;
2930 walletConnect : { projectId ?: string } | undefined ;
3031} ) {
31- const activeWallet = useAdminWallet ( ) ;
32+ const adminWallet = useAdminWallet ( ) ;
33+ const activeWallet = useActiveWallet ( ) ;
3234 const chain = useActiveWalletChain ( ) ;
3335 const queryClient = useQueryClient ( ) ;
3436
35- if ( ! activeWallet ) {
37+ const wallet = adminWallet || activeWallet ;
38+
39+ if ( ! wallet ) {
3640 return < LoadingScreen /> ;
3741 }
3842
39- if ( activeWallet . id === "inApp" ) {
43+ if ( wallet . id === "inApp" ) {
4044 return (
4145 < Suspense fallback = { < LoadingScreen /> } >
4246 < InAppWalletConnectUI
4347 walletConnect = { props . walletConnect }
44- wallet = { activeWallet as Wallet < "inApp" > }
48+ wallet = { wallet as Wallet < "inApp" > }
4549 done = { ( ) => {
4650 setTimeout ( ( ) => {
4751 queryClient . invalidateQueries ( { queryKey : [ "profiles" ] } ) ;
@@ -63,11 +67,11 @@ export function LinkProfileScreen(props: {
6367 ) ;
6468 }
6569
66- if ( isEcosystemWallet ( activeWallet ) ) {
70+ if ( isEcosystemWallet ( wallet ) ) {
6771 return (
6872 < Suspense fallback = { < LoadingScreen /> } >
6973 < EcosystemWalletConnectUI
70- wallet = { activeWallet as Wallet < EcosystemWalletId > }
74+ wallet = { wallet as Wallet < EcosystemWalletId > }
7175 done = { ( ) => {
7276 setTimeout ( ( ) => {
7377 queryClient . invalidateQueries ( { queryKey : [ "profiles" ] } ) ;
0 commit comments