protected override async Task OnInitializedAsync() { _newNotificationsAvailable = await NotificationService.AreNewNotificationsAvailable(); _messages = await NotificationService.GetNotifications(); await base.OnInitializedAsync(); }
protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender == true) { _newNotificationsAvailable = await NotificationService.AreNewNotificationsAvailable(); _messages = await NotificationService.GetNotifications(); StateHasChanged(); } await base.OnAfterRenderAsync(firstRender); }