fix: clear loadingTimeout

This commit is contained in:
max_richter 2025-01-20 23:42:22 +01:00
parent 19a1344d3d
commit cd511c9f0d

View File

@ -2,7 +2,7 @@ import { useEffect } from "preact/hooks";
declare global { declare global {
// deno-lint-ignore no-var // deno-lint-ignore no-var
var loadingTimeout: ReturnType<typeof setTimeout>; var loadingTimeout: ReturnType<typeof setTimeout> | undefined;
} }
export function Link( export function Link(
@ -24,6 +24,7 @@ export function Link(
useEffect(() => { useEffect(() => {
clearTimeout(globalThis.loadingTimeout); clearTimeout(globalThis.loadingTimeout);
delete globalThis.loadingTimeout;
setTimeout(() => { setTimeout(() => {
document.querySelector("main")?.classList.remove("loading"); document.querySelector("main")?.classList.remove("loading");
}, 100); }, 100);