Skip to content

Commit

Permalink
fix: suppress exceptions related to quick navigations performed by th…
Browse files Browse the repository at this point in the history
…e user (#216)

Co-authored-by: Luca Pisano <lucapisano@microsoft.com>
  • Loading branch information
lucapisano and Luca Pisano committed Sep 2, 2023
1 parent c6d87b5 commit 6bf3ffa
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ protected override async Task OnAfterRenderAsync(bool firstRender)

private async void NavigationManager_LocationChanged(object sender, LocationChangedEventArgs e)
{
await ApplicationInsights.TrackPageView();
try
{
await ApplicationInsights.TrackPageView();
}
catch (TaskCanceledException) { }//suppress exceptions related to quick navigations performed by the user
}

public void Dispose()
Expand Down

0 comments on commit 6bf3ffa

Please sign in to comment.