From b261d57f36cfba0d49d81c951b55772171e652dd Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 18 Oct 2023 09:29:40 -0400 Subject: [PATCH] refactor: don't enable browser until we are ready --- src/components/Browser.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Browser.tsx b/src/components/Browser.tsx index 2141f8b..d07787f 100644 --- a/src/components/Browser.tsx +++ b/src/components/Browser.tsx @@ -102,7 +102,6 @@ async function boot(status: LumeStatusContextType, auth: AuthContextType) { BOOT_FUNCTIONS.push(async () => await handshakeClient.register()); BOOT_FUNCTIONS.push(async () => await ethClient.register()); BOOT_FUNCTIONS.push(async () => await ipfsClient.register()); - BOOT_FUNCTIONS.push(async () => status.setReady(true)); const resolvers = [ "zrjCnUBqmBqXXcc2yPnq517sXQtNcfZ2BHgnVTcbhSYxko7", // CID @@ -113,6 +112,7 @@ async function boot(status: LumeStatusContextType, auth: AuthContextType) { for (const resolver of resolvers) { BOOT_FUNCTIONS.push(async () => dnsClient.registerResolver(resolver)); } + BOOT_FUNCTIONS.push(async () => status.setReady(true)); await bootup(); @@ -132,8 +132,8 @@ async function bootup() { export function Navigator() { const { url: contextUrl, setUrl } = useBrowserState(); - const { isLoggedIn } = useAuth(); const [inputValue, setInputValue] = useState(contextUrl); // Local state for the input value + const { ready } = useLumeStatus(); const browse = () => { let input = inputValue.trim(); @@ -169,9 +169,9 @@ export function Navigator() { setInputValue(e.target.value)} - disabled={!isLoggedIn} + disabled={!ready} /> -