MCPcopy Create free account
hub / github.com/CommE2E/comm / useCurrentUserFID

Function useCurrentUserFID

lib/utils/farcaster-utils.js:28–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26const NO_FID_METADATA = 'NONE';
27
28function useCurrentUserFID(): ?string {
29 // There is a distinction between null & undefined for the fid value.
30 // If the fid is null this means that the user has decided NOT to set
31 // a Farcaster association. If the fid is undefined this means that
32 // the user has not yet been prompted to set a Farcaster association.
33 const currentUserFID = useSelector(
34 state =>
35 state.syncedMetadataStore.syncedMetadata[
36 syncedMetadataNames.CURRENT_USER_FID
37 ] ?? undefined,
38 );
39
40 if (currentUserFID === NO_FID_METADATA) {
41 return null;
42 }
43
44 return currentUserFID;
45}
46
47function useCurrentUserSupportsDCs(): boolean {
48 const currentUserFIDDCs = useSelector(

Calls 1

useSelectorFunction · 0.90

Tested by

no test coverage detected