From d729b5199cd8740ef203b509079dd2aed0d70e23 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 22 Oct 2023 15:14:25 +0200 Subject: change url before content load --- web/script/transition.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/script') diff --git a/web/script/transition.ts b/web/script/transition.ts index eedc72d..2bf2a7b 100644 --- a/web/script/transition.ts +++ b/web/script/transition.ts @@ -57,11 +57,11 @@ function prepare_load(href: string, back?: boolean) { return show_error("unknown error when fetching page") } const [head, body] = rt.split("")[1].split("") + if (!back) window.history.pushState({}, "", href) document.head.innerHTML = head document.body.outerHTML = body globalThis.dispatchEvent(new Event("DOMContentLoaded")) fade(true) - if (!back) window.history.pushState({}, "", href) patch_page() } } -- cgit v1.2.3-70-g09d2