mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 10:51:07 +00:00
inspector app: don't set URL param for local filesystem archives
This commit is contained in:
@@ -42,10 +42,13 @@ function App() {
|
||||
let [file, setFile] = useState<PMTiles | undefined>(initialValue);
|
||||
|
||||
useEffect(() => {
|
||||
if (file) {
|
||||
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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user