From 248b4ec93c9beab762e1b7a9b4d4c6cbd3cca2e3 Mon Sep 17 00:00:00 2001 From: codytseng Date: Sun, 26 Oct 2025 16:21:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/PageManager.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PageManager.tsx b/src/PageManager.tsx index 98b31c73..3d21447a 100644 --- a/src/PageManager.tsx +++ b/src/PageManager.tsx @@ -274,19 +274,19 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) { }) } - const popSecondaryPage = () => { - if (secondaryStack.length === 1) { + const popSecondaryPage = (delta = -1) => { + if (secondaryStack.length <= -delta) { // back to home page window.history.replaceState(null, '', '/') setSecondaryStack([]) } else { - window.history.go(-1) + window.history.go(delta) } } const clearSecondaryPages = () => { if (secondaryStack.length === 0) return - window.history.go(-secondaryStack.length) + popSecondaryPage(-secondaryStack.length) } if (isSmallScreen) {