diff --git a/next_app/src/components/layout.tsx b/next_app/src/components/layout.tsx index 8634802..f9e3ac5 100644 --- a/next_app/src/components/layout.tsx +++ b/next_app/src/components/layout.tsx @@ -596,7 +596,7 @@ export default function Layout() { return ( <> - BetterIDEa | {globalState.activeProject || "Home"} + {`BetterIDEa ${globalState.activeProject && ("| " + globalState.activeProject)}`} diff --git a/next_app/src/pages/codecell.tsx b/next_app/src/pages/codecell.tsx index 23eb2e3..68adc90 100644 --- a/next_app/src/pages/codecell.tsx +++ b/next_app/src/pages/codecell.tsx @@ -30,6 +30,7 @@ export default function CodeCell() { console.log("autoconn", autoconnect) useEffect(() => { + if (searchParams.size > 0) { if (searchParams.has("code")) { setCode(searchParams.get("code") as string) @@ -52,14 +53,19 @@ export default function CodeCell() { } } - if (autoconnect && !mounted) { - window.arweaveWallet.getActiveAddress().then((addr: string) => { - connectHandler(); - setMounted(true); - }).catch(() => { - setAutoconnect(false); - }); + async function run() { + if (autoconnect && !mounted) { + try { + const addr = await window.arweaveWallet.getActiveAddress() + setWalletAddr(addr); + setAutoconnect(true); + } + catch { + setAutoconnect(false); + } + } } + run() }, [searchParams, autoconnect, mounted]) async function connectHandler() {