Fix Android crash when swiping back with modal open (#90)

This commit is contained in:
Yuri Karamian
2026-06-19 10:47:39 +02:00
parent 4f4e2854a6
commit 11673bd8c4
+10
View File
@@ -361,6 +361,16 @@
navFromPopstate = false; navFromPopstate = false;
return; 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 state = e.state;
const targetDepth = state?.depth ?? 0; const targetDepth = state?.depth ?? 0;
historyDepth = targetDepth; historyDepth = targetDepth;