Migliorata gestione e visualizzazione notifiche
This commit is contained in:
@@ -6,12 +6,14 @@
|
||||
@using salesbook.Shared.Core.Messages.Activity.Copy
|
||||
@using salesbook.Shared.Core.Messages.Activity.New
|
||||
@using salesbook.Shared.Core.Messages.Contact
|
||||
@using salesbook.Shared.Core.Messages.Notification
|
||||
@using salesbook.Shared.Core.Messages.Notification.Loaded
|
||||
@using salesbook.Shared.Core.Messages.Notification.NewPush
|
||||
@inject IDialogService Dialog
|
||||
@inject IMessenger Messenger
|
||||
@inject CopyActivityService CopyActivityService
|
||||
@inject NewPushNotificationService NewPushNotificationService
|
||||
@inject NotificationState Notification
|
||||
@inject NotificationsLoadedService NotificationsLoadedService
|
||||
|
||||
<div class="container animated-navbar @(IsVisible ? "show-nav" : "hide-nav") @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
|
||||
<nav class="navbar @(IsVisible ? PlusVisible ? "with-plus" : "without-plus" : "with-plus")">
|
||||
@@ -68,8 +70,7 @@
|
||||
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
CopyActivityService.OnCopyActivity += async dto => await CreateActivity(dto);
|
||||
NewPushNotificationService.OnNotificationReceived += NewNotificationReceived;
|
||||
InitMessage();
|
||||
|
||||
NavigationManager.LocationChanged += (_, args) =>
|
||||
{
|
||||
@@ -117,4 +118,11 @@
|
||||
Notification.ReceivedNotifications.Add(notification);
|
||||
InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private void InitMessage()
|
||||
{
|
||||
CopyActivityService.OnCopyActivity += async dto => await CreateActivity(dto);
|
||||
NewPushNotificationService.OnNotificationReceived += NewNotificationReceived;
|
||||
NotificationsLoadedService.OnNotificationsLoaded += () => InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user