fix: clear loadingTimeout
This commit is contained in:
parent
19a1344d3d
commit
cd511c9f0d
@ -2,7 +2,7 @@ import { useEffect } from "preact/hooks";
|
||||
|
||||
declare global {
|
||||
// deno-lint-ignore no-var
|
||||
var loadingTimeout: ReturnType<typeof setTimeout>;
|
||||
var loadingTimeout: ReturnType<typeof setTimeout> | undefined;
|
||||
}
|
||||
|
||||
export function Link(
|
||||
@ -24,6 +24,7 @@ export function Link(
|
||||
|
||||
useEffect(() => {
|
||||
clearTimeout(globalThis.loadingTimeout);
|
||||
delete globalThis.loadingTimeout;
|
||||
setTimeout(() => {
|
||||
document.querySelector("main")?.classList.remove("loading");
|
||||
}, 100);
|
||||
|
Loading…
x
Reference in New Issue
Block a user