diff --git a/src/Masa.Blazor.MobileComponents/Presets/PageStack/PPageStack.razor.cs b/src/Masa.Blazor.MobileComponents/Presets/PageStack/PPageStack.razor.cs index b7ea7ab9..ccf4cd5f 100644 --- a/src/Masa.Blazor.MobileComponents/Presets/PageStack/PPageStack.razor.cs +++ b/src/Masa.Blazor.MobileComponents/Presets/PageStack/PPageStack.razor.cs @@ -182,16 +182,11 @@ public partial class PPageStack : MasaComponentBase InvokeAsync(StateHasChanged); } - private bool _popstateExecuting = false; - [JSInvokable] public void Popstate(string absolutePath) { - if (_popstateExecuting) return; - _popstateExecuting = true; if (Pages.Count == 0) { - DelayPopstateExecute(); return; } @@ -216,7 +211,6 @@ public partial class PPageStack : MasaComponentBase await Task.Delay(DelayForPageClosingAnimation); // wait for the transition to complete Pages.RemoveRange(startIndex, delta); await InvokeAsync(StateHasChanged); - _popstateExecuting = false; }); return; @@ -230,7 +224,6 @@ public partial class PPageStack : MasaComponentBase Pages.RemoveRange(0, Pages.Count - 1); InternalReplaceHandler(relativeUri, state); _uriForReplaceAndClearStack = null; - DelayPopstateExecute(); return; } @@ -245,7 +238,7 @@ public partial class PPageStack : MasaComponentBase replaceUri = GetAbsolutePath(replaceUri); CloseTopPages(delta, disableTransition, state, replaceUri); _uriForGoBackToAndReplace = null; - DelayPopstateExecute(); + return; } @@ -272,7 +265,6 @@ public partial class PPageStack : MasaComponentBase if (_popstateByUserAction) { _popstateByUserAction = false; - DelayPopstateExecute(); return; } @@ -281,16 +273,6 @@ public partial class PPageStack : MasaComponentBase { CloseTopPageOfStack(); } - DelayPopstateExecute(); - } - - private void DelayPopstateExecute() - { - _ = Task.Run(async () => - { - await Task.Delay(150); - _popstateExecuting = false; - }); } [JSInvokable("Scroll")]