Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/stale-fans-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Fix useProfiles not updating when connecting to a different account
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function useProfiles(args: {
}): UseQueryResult<Profile[]> {
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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}): UseQueryResult<Profile[]> {
const wallet = useAdminWallet();
return useQuery({
queryKey: ["profiles", wallet?.id],
queryKey: ["profiles", wallet?.id, wallet?.getAccount()?.address],

Check warning on line 34 in packages/thirdweb/src/react/web/hooks/wallets/useProfiles.ts

View check run for this annotation

Codecov / codecov/patch

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

Added line #L34 was not covered by tests
enabled: !!wallet && (wallet.id === "inApp" || isEcosystemWallet(wallet)),
queryFn: async () => {
const ecosystem: Ecosystem | undefined =
Expand Down