diff --git a/lib/hooks/fc-cache.js b/lib/hooks/fc-cache.js --- a/lib/hooks/fc-cache.js +++ b/lib/hooks/fc-cache.js @@ -159,7 +159,7 @@ >(new Map()); React.useEffect(() => { - if (!fcCache || !fid || cachedAvatar !== undefined) { + if (!fcCache || !fid || cachedAvatar) { return; } void (async () => { @@ -186,4 +186,5 @@ } }, [fid, cachedAvatar, farcasterAvatars]); } + export { useFCNames, useFarcasterAvatar }; diff --git a/native/account/registration/avatar-selection.react.js b/native/account/registration/avatar-selection.react.js --- a/native/account/registration/avatar-selection.react.js +++ b/native/account/registration/avatar-selection.react.js @@ -51,7 +51,7 @@ }; function AvatarSelection(props: Props): React.Node { const { userSelections } = props.route.params; - const { accountSelection, farcasterAvatarURL, farcasterID } = userSelections; + const { accountSelection, farcasterAvatarURL } = userSelections; const usernameOrETHAddress = accountSelection.accountType === 'username' ? accountSelection.username @@ -186,7 +186,6 @@ userInfo={userInfoOverride} prefetchedENSAvatarURI={prefetchedENSAvatarURI} prefetchedFarcasterAvatarURL={farcasterAvatarURL} - fid={farcasterID} /> diff --git a/native/avatars/edit-user-avatar.react.js b/native/avatars/edit-user-avatar.react.js --- a/native/avatars/edit-user-avatar.react.js +++ b/native/avatars/edit-user-avatar.react.js @@ -10,6 +10,7 @@ import { useFarcasterAvatar } from 'lib/hooks/fc-cache.js'; import { getETHAddressForUserInfo } from 'lib/shared/account-utils.js'; import type { GenericUserInfoWithAvatar } from 'lib/types/avatar-types.js'; +import { useCurrentUserFID } from 'lib/utils/farcaster-utils.js'; import { useNativeSetUserAvatar, @@ -34,7 +35,6 @@ +disabled?: boolean, +prefetchedENSAvatarURI: ?string, +prefetchedFarcasterAvatarURL: ?string, - +fid: ?string, }; function EditUserAvatar(props: Props): React.Node { const editUserAvatarContext = React.useContext(EditUserAvatarContext); @@ -58,8 +58,9 @@ const fetchedENSAvatarURI = useENSAvatar(ethAddress); const ensAvatarURI = fetchedENSAvatarURI ?? props.prefetchedENSAvatarURI; + const fid = useCurrentUserFID(); const farcasterAvatarURL = - useFarcasterAvatar(props.fid) ?? props.prefetchedFarcasterAvatarURL; + useFarcasterAvatar(fid) ?? props.prefetchedFarcasterAvatarURL; const { navigate } = useNavigation();