From aa6ede68f08733865f2f019cf2a34eb30a7be49c Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Thu, 12 Oct 2023 12:48:57 -0400 Subject: [PATCH] refactor: move state detection to context so we can set it at the app level --- src/components/lume/LumeProvider.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/lume/LumeProvider.tsx b/src/components/lume/LumeProvider.tsx index d4bf160..2357391 100644 --- a/src/components/lume/LumeProvider.tsx +++ b/src/components/lume/LumeProvider.tsx @@ -35,6 +35,7 @@ type LumeContextType = { setIsLoggedIn: (value: boolean) => void; lume: LumeObject; ready: boolean; + setReady: React.Dispatch>; }; const networkRegistry = createNetworkRegistryClient(); @@ -122,8 +123,6 @@ const LumeProvider = ({ children }) => { useEffect(() => { fetchAndUpdateNetworks(); - loginComplete().then(() => isMounted.current && setIsLoggedIn(true)); - init().then(() => isMounted.current && setReady(true)); const subDone = networkRegistry.subscribeToUpdates(() => fetchAndUpdateNetworks(), @@ -137,7 +136,8 @@ const LumeProvider = ({ children }) => { }, [fetchAndUpdateNetworks]); return ( - + {children} );