Browse Source

fix panel navigaiton in explore page

imwald
Silberengel 3 months ago
parent
commit
0156f9eba4
  1. 12
      src/PageManager.tsx

12
src/PageManager.tsx

@ -1260,6 +1260,18 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) { @@ -1260,6 +1260,18 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) {
}))
currentTabStateRef.current.set('search', savedFeedState.trendingTab)
}
} else if (secondaryStack.length > 1) {
// Pop from stack directly instead of using history.go(-1)
// This ensures the stack is updated immediately
setSecondaryStack((prevStack) => {
const newStack = prevStack.slice(0, -1)
const topItem = newStack[newStack.length - 1]
if (topItem) {
// Update URL to match the top item
window.history.replaceState({ index: topItem.index, url: topItem.url }, '', topItem.url)
}
return newStack
})
} else {
// Just go back in history - popstate will handle stack update
window.history.go(-1)

Loading…
Cancel
Save