Skip to content

Commit

Permalink
Improve Navigation Performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Loudbooks committed Dec 23, 2024
1 parent 30ae861 commit 0ffc353
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions frontend/src/components/Toolbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { onMount } from "svelte";
import { title } from "$lib/stores";
import { disableNew } from "$lib/stores";
import { goto } from "$app/navigation";
onMount(() => {
const toolbar = document.querySelector("toolbar") as HTMLElement;
Expand All @@ -11,15 +12,15 @@
});
function newPaste() {
window.location.href = "/new";
goto("/new");
}
function settings() {
window.location.href = "/settings";
goto("/settings");
}
function home() {
window.location.href = "/";
goto("/");
}
</script>

Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/new/Submit.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { expire, wrap, writableTitle } from "$lib/stores.ts";
import { writableContent } from "$lib/stores.ts";
import { onMount } from "svelte";
Expand Down Expand Up @@ -70,7 +71,7 @@
return;
}
window.location.replace("/p/" + xhr.response);
goto("/p/" + xhr.response);
};
}
Expand Down

0 comments on commit 0ffc353

Please sign in to comment.