inspector app: don't set URL param for local filesystem archives

This commit is contained in:
Brandon Liu
2022-07-07 12:11:03 +08:00
parent b285f77bc4
commit abf1dd9372

View File

@@ -42,10 +42,13 @@ function App() {
let [file, setFile] = useState<PMTiles | undefined>(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]);