mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Set delayed loading spinner and additional CSP headers
This commit is contained in:
@@ -14,9 +14,21 @@
|
||||
? "Dashboard"
|
||||
: `${$page.url.pathname.charAt(1).toUpperCase()}${$page.url.pathname.slice(2)}`
|
||||
);
|
||||
|
||||
let loading = $state(false);
|
||||
let loadingDelay: number;
|
||||
|
||||
$effect(() => {
|
||||
if ($navigating && ["link", "goto"].includes($navigating.type)) {
|
||||
loadingDelay = window.setTimeout(() => (loading = true), 500);
|
||||
} else {
|
||||
window.clearTimeout(loadingDelay);
|
||||
loading = false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if $navigating && ["link", "goto"].includes($navigating.type)}
|
||||
{#if loading}
|
||||
<LoadingSpinner />
|
||||
{/if}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user