Update navigation loading and NGINX try_file

This commit is contained in:
thiloho
2024-09-15 17:54:54 +02:00
parent aecbd64893
commit e506764bbd
3 changed files with 8 additions and 19 deletions

View File

@@ -3,20 +3,11 @@
import { page } from "$app/stores";
import type { LayoutServerData } from "./$types";
import type { Snippet } from "svelte";
import { beforeNavigate, afterNavigate } from "$app/navigation";
import { navigating } from "$app/stores";
import LoadingSpinner from "$lib/components/LoadingSpinner.svelte";
const { data, children }: { data: LayoutServerData; children: Snippet } = $props();
let loading = $state(false);
beforeNavigate(() => {
loading = true;
});
afterNavigate(() => {
loading = false;
});
const isProjectRoute = $derived($page.url.pathname.startsWith("/website") && !$page.error);
const routeName = $derived(
$page.url.pathname === "/"
@@ -25,7 +16,7 @@
);
</script>
{#if loading}
{#if $navigating}
<LoadingSpinner />
{/if}