diff --git a/lib/components/farcaster-data-handler.react.js b/lib/components/farcaster-data-handler.react.js
--- a/lib/components/farcaster-data-handler.react.js
+++ b/lib/components/farcaster-data-handler.react.js
@@ -19,7 +19,13 @@
import { useSelector, useDispatch } from '../utils/redux-utils.js';
import { usingCommServicesAccessToken } from '../utils/services-utils.js';
-function FarcasterDataHandler(): React.Node {
+type Props = {
+ +children?: React.Node,
+};
+
+function FarcasterDataHandler(props: Props): React.Node {
+ const { children } = props;
+
const isActive = useSelector(state => state.lifecycleState !== 'background');
const currentUserID = useSelector(state => state.currentUserInfo?.id);
@@ -139,6 +145,8 @@
const prevCanQueryHandleCurrentUserFIDRef = React.useRef();
const canQueryHandleCurrentUserFID = isActive && loggedIn;
+ const [fidLoaded, setFIDLoaded] = React.useState(false);
+
const handleCurrentUserFID = React.useCallback(async () => {
if (
canQueryHandleCurrentUserFID ===
@@ -181,6 +189,8 @@
},
});
}
+
+ setFIDLoaded(true);
}, [
canQueryHandleCurrentUserFID,
findUserIdentities,
@@ -201,7 +211,23 @@
void handleCurrentUserFID();
}, [handleCurrentUserFID, handleFarcasterMutuals, handleUserStoreFIDs]);
- return null;
+ React.useEffect(() => {
+ if (loggedIn) {
+ return;
+ }
+
+ setFIDLoaded(false);
+ }, [loggedIn]);
+
+ const farcasterDataHandler = React.useMemo(() => {
+ if (!fidLoaded) {
+ return null;
+ }
+
+ return children;
+ }, [children, fidLoaded]);
+
+ return farcasterDataHandler;
}
export { FarcasterDataHandler };
diff --git a/native/root.react.js b/native/root.react.js
--- a/native/root.react.js
+++ b/native/root.react.js
@@ -308,7 +308,11 @@
-
+
+
+
+
+
);
@@ -367,7 +371,6 @@
-
{navigation}