Skip to content

Commit

Permalink
fix: bugfix for avatar management state (#10698)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuanyang233 authored and guanbinrui committed Sep 5, 2023
1 parent dcd0e58 commit 6741164
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function useSocialIdentity(identity: IdentityResolved | null | undefined)
if (!platform || !identity) return
return getSocialIdentity(platform, identity)
},
refetchOnWindowFocus: false,
})

useEffect(() => MaskMessages.events.ownProofChanged.on(() => result.refetch()), [result.refetch])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,13 @@ export const AvatarManagementProvider = memo(({ children, socialIdentity }: Prop
const [selectedTokenInfo, setSelectedTokenInfo] = useState<SelectTokenInfo>()

const contextValue: AvatarManagementContextOptions = useMemo(() => {
setProof(first(nextIDPersonas))
setProofs(nextIDWallets)
setSelectedAccount(account || first(nextIDWallets)?.identity || '')
return {
pfpType: PFP_TYPE.PFP,
targetAccount: selectedAccount,
targetAccount: selectedAccount ?? (account || first(nextIDWallets)?.identity || ''),
setTargetAccount: setSelectedAccount,
proof,
proof: proof ?? first(nextIDPersonas),
setProof,
proofs: proofs.length ? proofs : nextIDWallets,
proofs: proofs ?? nextIDWallets,
setProofs,
tokenInfo,
setTokenInfo,
Expand Down

0 comments on commit 6741164

Please sign in to comment.