Skip to content

Commit 5178ea6

Browse files
fix: prevent MoreDrawer sentinel from undoing navigation
1 parent 6e8bc78 commit 5178ea6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

frontend/src/components/navigation/MoreDrawer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@ export function MoreDrawer({ isOpen, onClose }: MoreDrawerProps) {
6767
window.addEventListener('popstate', onPop)
6868
return () => {
6969
window.removeEventListener('popstate', onPop)
70+
// Only go back if sentinel is still active AND we haven't navigated away
7071
if (sentinelActive) {
7172
sentinelActive = false
7273
const top = window.history.state as { moreDrawerSentinel?: boolean } | null
73-
if (top?.moreDrawerSentinel) {
74+
// Only go back if the current URL hasn't changed (i.e., no navigation occurred)
75+
if (top?.moreDrawerSentinel && window.location.href === baseUrl) {
7476
window.history.back()
7577
}
7678
}

0 commit comments

Comments
 (0)