File tree Expand file tree Collapse file tree 5 files changed +19
-11
lines changed
packages/thirdweb/src/react Expand file tree Collapse file tree 5 files changed +19
-11
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " thirdweb " : patch
3
+ ---
4
+
5
+ Allow linking accounts when using in-app + smart wallets
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wa
3
3
import type { Profile } from "../../../../wallets/in-app/core/authentication/types.js" ;
4
4
import { getProfiles } from "../../../../wallets/in-app/core/wallet/profiles.js" ;
5
5
import type { Wallet } from "../../../../wallets/interfaces/wallet.js" ;
6
- import { useActiveWallet } from "../wallets/useActiveWallet .js" ;
6
+ import { useAdminWallet } from "../wallets/useAdminAccount .js" ;
7
7
8
8
/**
9
9
* Retrieves all linked profiles for the current wallet.
@@ -25,7 +25,7 @@ import { useActiveWallet } from "../wallets/useActiveWallet.js";
25
25
* @wallet
26
26
*/
27
27
export function useProfiles ( ) : UseQueryResult < Profile [ ] > {
28
- const wallet = useActiveWallet ( ) ;
28
+ const wallet = useAdminWallet ( ) ;
29
29
30
30
return useQuery ( {
31
31
queryKey : [ "profiles" , wallet ?. id ] ,
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ 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" ;
11
10
import { useActiveWalletChain } from "../../../../core/hooks/wallets/useActiveWalletChain.js" ;
11
+ import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminAccount.js" ;
12
12
import EcosystemWalletConnectUI from "../../../wallets/ecosystem/EcosystemWalletConnectUI.js" ;
13
13
import { LoadingScreen } from "../../../wallets/shared/LoadingScreen.js" ;
14
14
import { Container , Line , ModalHeader } from "../../components/basic.js" ;
@@ -28,7 +28,7 @@ export function LinkProfileScreen(props: {
28
28
client : ThirdwebClient ;
29
29
walletConnect : { projectId ?: string } | undefined ;
30
30
} ) {
31
- const activeWallet = useActiveWallet ( ) ;
31
+ const activeWallet = useAdminWallet ( ) ;
32
32
const chain = useActiveWalletChain ( ) ;
33
33
const queryClient = useQueryClient ( ) ;
34
34
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { isInAppWallet } from "../../../../../wallets/in-app/core/wallet/index.j
6
6
import { injectedProvider } from "../../../../../wallets/injected/mipdStore.js" ;
7
7
import { fontSize , iconSize } from "../../../../core/design-system/index.js" ;
8
8
import { useActiveWallet } from "../../../../core/hooks/wallets/useActiveWallet.js" ;
9
+ import { useAdminWallet } from "../../../../core/hooks/wallets/useAdminAccount.js" ;
9
10
import { Spacer } from "../../components/Spacer.js" ;
10
11
import { Container , Line , ModalHeader } from "../../components/basic.js" ;
11
12
import { Text } from "../../components/text.js" ;
@@ -26,7 +27,7 @@ export function ManageWalletScreen(props: {
26
27
locale : ConnectLocale ;
27
28
client : ThirdwebClient ;
28
29
} ) {
29
- const activeWallet = useActiveWallet ( ) ;
30
+ const activeWallet = useAdminWallet ( ) ;
30
31
31
32
return (
32
33
< Container
Original file line number Diff line number Diff line change @@ -53,12 +53,14 @@ function InAppWalletConnectUI(props: {
53
53
54
54
// if the the modal starts out with the wallet's connect ui instead of wallet selector - going back to main screen requires staying on the same component and clearing the selection data
55
55
// otherwise, we go back to the wallet selector by calling props.goBack
56
- const goBackToMain =
57
- initialScreen === props . wallet
58
- ? ( ) => {
59
- setSelectionData ( { } ) ;
60
- }
61
- : props . goBack ;
56
+ const goBackToMain = ( ) => {
57
+ if ( initialScreen === props . wallet ) {
58
+ setSelectionData ( { } ) ;
59
+ } else {
60
+ props . goBack ?.( ) ;
61
+ setSelectionData ( { } ) ;
62
+ }
63
+ } ;
62
64
63
65
const done = ( ) => {
64
66
props . done ( ) ;
You can’t perform that action at this time.
0 commit comments