fix: fall back to about:blank in the iframe, not the state

This commit is contained in:
Derrick Hammer 2023-10-16 19:45:15 -04:00
parent f558399da4
commit 59cadac430
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 7 additions and 2 deletions

View File

@ -45,7 +45,7 @@ export function BrowserStateProvider({
}: {
children: React.ReactElement;
}) {
const [url, setUrl] = useState("about:blank");
const [url, setUrl] = useState("");
return (
<BrowserStateContext.Provider value={{ url, setUrl }}>
@ -190,5 +190,10 @@ export function Browser() {
boot(status, auth);
}, []);
return <iframe src={`/browse/${url}`} className="w-full h-full"></iframe>;
return (
<iframe
src={url ? `/browse/${url}` : "about:blank"}
className="w-full h-full"
></iframe>
);
}