StackedRouter: don't push frame if the stack empty

This commit is contained in:
thislight 2024-11-19 16:46:44 +08:00
parent 4d3f5c911b
commit 0a9d833f09
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E

View file

@ -259,7 +259,10 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
createRenderEffect(() => { createRenderEffect(() => {
if (stack.length === 0) { if (stack.length === 0) {
pushFrame(window.location.pathname); mutStack(0, {
path: window.location.pathname,
rootId: createUniqueId(),
});
} }
}); });