From da1db64e326a1093e3048a71036e7cef0c501513 Mon Sep 17 00:00:00 2001 From: not-nullptr Date: Fri, 8 Mar 2024 08:49:57 +0000 Subject: [PATCH] improve exclusions --- src/routes/+layout.svelte | 5 +++-- src/routes/mockup/boot/[game]/+page.svelte | 23 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 85a0cdd..dc9a20a 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -4,11 +4,12 @@ import LogoWithTextHorizontal from "$components/LogoWithTextHorizontal.svelte"; import { page } from "$app/stores"; import "$lib/css/index.css"; + import { onMount } from "svelte"; const excludedRoutesNav = ["/mockup/boot"]; const excludedRoutesBg = ["/mockup"]; - $: isNavExcluded = excludedRoutesNav.some((route) => $page.url.pathname.startsWith(route)); - $: isBgExcluded = excludedRoutesBg.some((route) => $page.url.pathname === route); + $: isNavExcluded = excludedRoutesNav.some((route) => $page.url?.pathname.startsWith(route)); + $: isBgExcluded = excludedRoutesBg.some((route) => $page.url?.pathname === route); {#if !isNavExcluded} diff --git a/src/routes/mockup/boot/[game]/+page.svelte b/src/routes/mockup/boot/[game]/+page.svelte index e5cab4a..6d6448c 100644 --- a/src/routes/mockup/boot/[game]/+page.svelte +++ b/src/routes/mockup/boot/[game]/+page.svelte @@ -3,13 +3,16 @@ import { onMount } from "svelte"; import type { PageData } from "./$types"; import Logo from "$components/Logo.svelte"; + import { page } from "$app/stores"; let shadersDone = 0; const shadersTotal = 8146; export let data: PageData; - - $: game = data.props.games[0]; + $: game = + data.props.games.find( + (g) => g.title.trim().toLowerCase() === $page.params.game.trim().toLowerCase(), + ) || data.props.games[0]; onMount(() => { const interval = setInterval(() => { shadersDone += Math.floor(Math.random() * 150); @@ -44,7 +47,7 @@