feat: update surface URL when changing axes

feat/type-attributes
Tomáš Mládek 2023-01-24 23:51:26 +01:00
parent 4c1231a4ba
commit 7993e94ce5
1 changed files with 6 additions and 3 deletions

View File

@ -9,14 +9,17 @@
import BlobPreview from "../components/display/BlobPreview.svelte";
import { i18n } from "../i18n";
import type { IValue } from "upend/types";
import { useNavigate } from "svelte-navigator";
const navigate = useNavigate();
const urlSearch = window.location.href.substring(
window.location.href.indexOf("?")
const urlParams = new URLSearchParams(
window.location.href.substring(window.location.href.indexOf("?"))
);
const urlParams = new URLSearchParams(urlSearch);
export let x: string = urlParams.get("x");
export let y: string = urlParams.get("y");
$: if (x && y) navigate(`/surface?x=${x}&y=${y}`, { replace: true });
let viewMode = "link";
let currentX = NaN;