diff --git a/app/src/App.tsx b/app/src/App.tsx index a2646f5..1c25b5f 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -42,10 +42,13 @@ function App() { let [file, setFile] = useState(initialValue); useEffect(() => { - if (file) { - const url = new URL(window.location.href); + const url = new URL(window.location.href); + if (file && file.source.getKey().startsWith("http")) { url.searchParams.set("url", file.source.getKey()); history.pushState(null, "", url.toString()); + } else { + url.searchParams.delete("url"); + history.pushState(null, "", url.toString()); } }, [file]);