Skip to content

Commit

Permalink
Merge pull request #65 from IvanJosipovic/beta
Browse files Browse the repository at this point in the history
fix: Bug #64 - Set Location Handler OnAfterRenderAsync instead of OnInitialized
  • Loading branch information
IvanJosipovic authored Mar 9, 2021
2 parents 95c6946 + aa7eb29 commit df9cf75
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@ public partial class ApplicationInsightsComponent : IDisposable
[Inject] private NavigationManager NavigationManager { get; set; }
[Inject] private IJSRuntime JSRuntime { get; set; }

protected override void OnInitialized()
{
NavigationManager.LocationChanged += NavigationManager_LocationChanged;
}

protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await ApplicationInsights.InitBlazorApplicationInsightsAsync(JSRuntime);
NavigationManager.LocationChanged += NavigationManager_LocationChanged;
}
}

Expand Down

0 comments on commit df9cf75

Please sign in to comment.