diff --git a/.changeset/stale-fans-ring.md b/.changeset/stale-fans-ring.md new file mode 100644 index 00000000000..c83f9d3af89 --- /dev/null +++ b/.changeset/stale-fans-ring.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Fix useProfiles not updating when connecting to a different account diff --git a/packages/thirdweb/src/react/native/hooks/wallets/useProfiles.ts b/packages/thirdweb/src/react/native/hooks/wallets/useProfiles.ts index 1334dd04c74..540e92fa891 100644 --- a/packages/thirdweb/src/react/native/hooks/wallets/useProfiles.ts +++ b/packages/thirdweb/src/react/native/hooks/wallets/useProfiles.ts @@ -31,7 +31,7 @@ export function useProfiles(args: { }): UseQueryResult { const wallet = useAdminWallet(); return useQuery({ - queryKey: ["profiles", wallet?.id], + queryKey: ["profiles", wallet?.id, wallet?.getAccount()?.address], enabled: !!wallet && (wallet.id === "inApp" || isEcosystemWallet(wallet)), queryFn: async () => { const ecosystem: Ecosystem | undefined = diff --git a/packages/thirdweb/src/react/web/hooks/wallets/useProfiles.ts b/packages/thirdweb/src/react/web/hooks/wallets/useProfiles.ts index 1334dd04c74..540e92fa891 100644 --- a/packages/thirdweb/src/react/web/hooks/wallets/useProfiles.ts +++ b/packages/thirdweb/src/react/web/hooks/wallets/useProfiles.ts @@ -31,7 +31,7 @@ export function useProfiles(args: { }): UseQueryResult { const wallet = useAdminWallet(); return useQuery({ - queryKey: ["profiles", wallet?.id], + queryKey: ["profiles", wallet?.id, wallet?.getAccount()?.address], enabled: !!wallet && (wallet.id === "inApp" || isEcosystemWallet(wallet)), queryFn: async () => { const ecosystem: Ecosystem | undefined =