From abf1dd9372170c696d20d108fda2d7a3f29c7279 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Thu, 7 Jul 2022 12:11:03 +0800 Subject: [PATCH] inspector app: don't set URL param for local filesystem archives --- app/src/App.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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]);