From 8d18d99bcb0de518dd0b60a1f7e022e0cf516efa Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 19 May 2026 02:41:45 +0000 Subject: fix(nav): respect displayDisableAnimations in view transitions Root.svelte already gated the fly transition on \$settings.displayDisableAnimations, but the View Transition path added in 7e2495bd ran unconditionally. The setting appeared broken because the slide kept firing via the browser API. Adds the same check to onNavigate via get(settings) (the callback is not in reactive context, so a synchronous store read is the right shape). When the setting is on, both transition paths bypass and navigation snaps as expected. --- src/routes/+layout.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index e2cb4132..a61d0a29 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -9,7 +9,7 @@ import settings from "$stores/settings"; import { browser } from "$app/environment"; import HeadTitle from "$lib/Home/HeadTitle.svelte"; import "../app.css"; -import { readable, type Readable } from "svelte/store"; +import { get, readable, type Readable } from "svelte/store"; import { navigating } from "$app/stores"; import { onNavigate } from "$app/navigation"; import NotificationsProvider from "$lib/Notification/NotificationsProvider.svelte"; @@ -94,6 +94,7 @@ $: if ($navigating) isMenuOpen = false; onNavigate((navigation) => { if (!("startViewTransition" in document)) return; if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return; + if (get(settings).displayDisableAnimations) return; const fromPath = navigation.from?.url.pathname ?? "/"; const toPath = navigation.to?.url.pathname ?? "/"; -- cgit v1.2.3