diff options
-rw-r--r-- | web/script/transition.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/web/script/transition.ts b/web/script/transition.ts index 6616bc0..eedc72d 100644 --- a/web/script/transition.ts +++ b/web/script/transition.ts @@ -12,8 +12,10 @@ globalThis.addEventListener("load", () => { patch_page() }) -globalThis.addEventListener("popstate", (_e) => { - transition_to(window.location.href, true) +globalThis.addEventListener("popstate", async (_e) => { + const had_disable_transition = disable_transition; + await transition_to(window.location.href, true) + if (had_disable_transition) window.location.reload() }) let disable_transition = false @@ -35,6 +37,7 @@ async function transition_to(href: string, back?: boolean) { const trigger_load = prepare_load(href, back) await fade(false) trigger_load() + disable_transition = false; } function show_error(mesg: string) { |