Skip to content

Commit 541bee5

Browse files
fix: update useProfiles when connecting to different account (#5089)
1 parent df128bf commit 541bee5

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/stale-fans-ring.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Fix useProfiles not updating when connecting to a different account

packages/thirdweb/src/react/native/hooks/wallets/useProfiles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function useProfiles(args: {
3131
}): UseQueryResult<Profile[]> {
3232
const wallet = useAdminWallet();
3333
return useQuery({
34-
queryKey: ["profiles", wallet?.id],
34+
queryKey: ["profiles", wallet?.id, wallet?.getAccount()?.address],
3535
enabled: !!wallet && (wallet.id === "inApp" || isEcosystemWallet(wallet)),
3636
queryFn: async () => {
3737
const ecosystem: Ecosystem | undefined =

packages/thirdweb/src/react/web/hooks/wallets/useProfiles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function useProfiles(args: {
3131
}): UseQueryResult<Profile[]> {
3232
const wallet = useAdminWallet();
3333
return useQuery({
34-
queryKey: ["profiles", wallet?.id],
34+
queryKey: ["profiles", wallet?.id, wallet?.getAccount()?.address],
3535
enabled: !!wallet && (wallet.id === "inApp" || isEcosystemWallet(wallet)),
3636
queryFn: async () => {
3737
const ecosystem: Ecosystem | undefined =

0 commit comments

Comments
 (0)