From 11673bd8c44661355921acd29135cf77e7627beb Mon Sep 17 00:00:00 2001 From: Yuri Karamian Date: Fri, 19 Jun 2026 10:47:39 +0200 Subject: [PATCH] Fix Android crash when swiping back with modal open (#90) --- src/lib/components/AppLayout.svelte | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/components/AppLayout.svelte b/src/lib/components/AppLayout.svelte index b75ab7e..608a9cc 100644 --- a/src/lib/components/AppLayout.svelte +++ b/src/lib/components/AppLayout.svelte @@ -361,6 +361,16 @@ navFromPopstate = false; return; } + // If a modal is open, close it instead of navigating + if ($showSettings || $showInfo || $showSearch || $showCommandPalette) { + $showSettings = false; + $showInfo = false; + $showSearch = false; + $showCommandPalette = false; + // Re-push the current state so the next back still works + history.pushState({ mobileView: $mobileView, depth: historyDepth }, ''); + return; + } const state = e.state; const targetDepth = state?.depth ?? 0; historyDepth = targetDepth;