Skip to content

Commit

Permalink
Simplify NavigationHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamescaper committed Sep 6, 2023
1 parent ffd7b97 commit 7af8b66
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/BlazorBindings.Maui/Navigation/NavigationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ public NavigationHandler(MC.INavigation navigation, NavigationTarget target, boo

public async Task AddChildAsync(MC.Page child)
{
// The order of AddChild and RemoveChild is undetermined. We need to make sure that the previous page is removed.
if (_currentPage != null)
await RemoveChildAsync(_currentPage);

_currentPage = child;

if (_target == NavigationTarget.Modal)
Expand Down Expand Up @@ -67,6 +63,7 @@ private void ParentChanged(object sender, EventArgs e)

if (page == _currentPage && page.Parent == null)
{
// Notify that the page is closed so that rootComponent could be removed from Blazor tree.
PageClosed?.Invoke();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

refreshView.IsRefreshing = true;

await Task.Delay(5);
await Task.Delay(10);
Assert.That(refreshInvokeStarted, Is.True);
Assert.That(refreshView.IsRefreshing, Is.True);

Expand Down

0 comments on commit 7af8b66

Please sign in to comment.