fix: 🐛
This commit is contained in:
@@ -274,19 +274,19 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const popSecondaryPage = () => {
|
const popSecondaryPage = (delta = -1) => {
|
||||||
if (secondaryStack.length === 1) {
|
if (secondaryStack.length <= -delta) {
|
||||||
// back to home page
|
// back to home page
|
||||||
window.history.replaceState(null, '', '/')
|
window.history.replaceState(null, '', '/')
|
||||||
setSecondaryStack([])
|
setSecondaryStack([])
|
||||||
} else {
|
} else {
|
||||||
window.history.go(-1)
|
window.history.go(delta)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const clearSecondaryPages = () => {
|
const clearSecondaryPages = () => {
|
||||||
if (secondaryStack.length === 0) return
|
if (secondaryStack.length === 0) return
|
||||||
window.history.go(-secondaryStack.length)
|
popSecondaryPage(-secondaryStack.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSmallScreen) {
|
if (isSmallScreen) {
|
||||||
|
|||||||
Reference in New Issue
Block a user