@@ -7,6 +7,7 @@ import { isEcosystemWallet } from "../../../../../wallets/ecosystem/is-ecosystem
7
7
import type { Wallet } from "../../../../../wallets/interfaces/wallet.js" ;
8
8
import type { EcosystemWalletId } from "../../../../../wallets/wallet-types.js" ;
9
9
import { iconSize } from "../../../../core/design-system/index.js" ;
10
+ import { useActiveWallet } from "../../../../core/hooks/wallets/useActiveWallet.js" ;
10
11
import { useActiveWalletChain } from "../../../../core/hooks/wallets/useActiveWalletChain.js" ;
11
12
import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminWallet.js" ;
12
13
import EcosystemWalletConnectUI from "../../../wallets/ecosystem/EcosystemWalletConnectUI.js" ;
@@ -28,20 +29,23 @@ export function LinkProfileScreen(props: {
28
29
client : ThirdwebClient ;
29
30
walletConnect : { projectId ?: string } | undefined ;
30
31
} ) {
31
- const activeWallet = useAdminWallet ( ) ;
32
+ const adminWallet = useAdminWallet ( ) ;
33
+ const activeWallet = useActiveWallet ( ) ;
32
34
const chain = useActiveWalletChain ( ) ;
33
35
const queryClient = useQueryClient ( ) ;
34
36
35
- if ( ! activeWallet ) {
37
+ const wallet = adminWallet || activeWallet ;
38
+
39
+ if ( ! wallet ) {
36
40
return < LoadingScreen /> ;
37
41
}
38
42
39
- if ( activeWallet . id === "inApp" ) {
43
+ if ( wallet . id === "inApp" ) {
40
44
return (
41
45
< Suspense fallback = { < LoadingScreen /> } >
42
46
< InAppWalletConnectUI
43
47
walletConnect = { props . walletConnect }
44
- wallet = { activeWallet as Wallet < "inApp" > }
48
+ wallet = { wallet as Wallet < "inApp" > }
45
49
done = { ( ) => {
46
50
setTimeout ( ( ) => {
47
51
queryClient . invalidateQueries ( { queryKey : [ "profiles" ] } ) ;
@@ -63,11 +67,11 @@ export function LinkProfileScreen(props: {
63
67
) ;
64
68
}
65
69
66
- if ( isEcosystemWallet ( activeWallet ) ) {
70
+ if ( isEcosystemWallet ( wallet ) ) {
67
71
return (
68
72
< Suspense fallback = { < LoadingScreen /> } >
69
73
< EcosystemWalletConnectUI
70
- wallet = { activeWallet as Wallet < EcosystemWalletId > }
74
+ wallet = { wallet as Wallet < EcosystemWalletId > }
71
75
done = { ( ) => {
72
76
setTimeout ( ( ) => {
73
77
queryClient . invalidateQueries ( { queryKey : [ "profiles" ] } ) ;
0 commit comments