Skip to content

Commit

Permalink
fix url
Browse files Browse the repository at this point in the history
  • Loading branch information
kobakazu0429 committed Nov 9, 2023
1 parent 9c8af1b commit 0d8befc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
</script>

<Router>
<Route path="/" let:location><Index {location} /></Route>
<Route path="/"><Index /></Route>
<Route path="/admin"><Admin /></Route>
</Router>
8 changes: 4 additions & 4 deletions src/pages/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import { enableFullScreenEditor } from "../editor/fullscreen";
import { registerShortcuts } from "../shortcuts";
import { onDestroy, onMount } from "svelte";
import { useLocation } from "svelte-routing";
import { downloadCode, formatCode, newFile } from "../editor/utils";
import { compile } from "../runners/compile";
import { run } from "../runners/exec";
Expand All @@ -46,11 +47,10 @@
unregisterShortcuts();
});
export let location: Location;
const location = useLocation();
$: {
if (location) {
const params = new URLSearchParams(location.search);
if ($location.search) {
const params = new URLSearchParams($location.search);
const lz = params.get("data");
lzStore.set(lz);
}
Expand Down

0 comments on commit 0d8befc

Please sign in to comment.