From 0156f9eba4a729d80cc0f9cd7488e68f1955f5df Mon Sep 17 00:00:00 2001 From: Silberengel Date: Mon, 8 Dec 2025 21:29:51 +0100 Subject: [PATCH] fix panel navigaiton in explore page --- src/PageManager.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/PageManager.tsx b/src/PageManager.tsx index e77932e..c69a60e 100644 --- a/src/PageManager.tsx +++ b/src/PageManager.tsx @@ -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)