From 0a9d833f09ecd68c540962dc17199a7eb0466dfc Mon Sep 17 00:00:00 2001 From: thislight Date: Tue, 19 Nov 2024 16:46:44 +0800 Subject: [PATCH] StackedRouter: don't push frame if the stack empty --- src/platform/StackedRouter.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platform/StackedRouter.tsx b/src/platform/StackedRouter.tsx index 07b3526..bc3e948 100644 --- a/src/platform/StackedRouter.tsx +++ b/src/platform/StackedRouter.tsx @@ -259,7 +259,10 @@ const StackedRouter: Component = (oprops) => { createRenderEffect(() => { if (stack.length === 0) { - pushFrame(window.location.pathname); + mutStack(0, { + path: window.location.pathname, + rootId: createUniqueId(), + }); } });