Migliorata gestione e visualizzazione notifiche
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
@page "/"
|
||||
@attribute [Authorize]
|
||||
@using CommunityToolkit.Mvvm.Messaging
|
||||
@using salesbook.Shared.Core.Interface
|
||||
@using salesbook.Shared.Components.Layout.Spinner
|
||||
@using salesbook.Shared.Core.Interface.System.Network
|
||||
@using salesbook.Shared.Core.Interface.System.Notification
|
||||
@using salesbook.Shared.Core.Messages.Notification.Loaded
|
||||
@using salesbook.Shared.Core.Services
|
||||
@inject IFormFactor FormFactor
|
||||
@inject INetworkService NetworkService
|
||||
@inject IFirebaseNotificationService FirebaseNotificationService
|
||||
@inject IShinyNotificationManager NotificationManager
|
||||
@inject INotificationService NotificationService
|
||||
@inject PreloadService PreloadService
|
||||
@inject IMessenger Messenger
|
||||
|
||||
<SpinnerLayout FullScreen="true" />
|
||||
|
||||
@@ -17,6 +21,7 @@
|
||||
{
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadNotification();
|
||||
await CheckAndRequestPermissions();
|
||||
|
||||
try
|
||||
@@ -40,6 +45,12 @@
|
||||
NavigationManager.NavigateTo("/Calendar");
|
||||
}
|
||||
|
||||
private async Task LoadNotification()
|
||||
{
|
||||
await NotificationService.LoadNotification();
|
||||
Messenger.Send(new NotificationsLoadedMessage());
|
||||
}
|
||||
|
||||
private async Task CheckAndRequestPermissions()
|
||||
{
|
||||
await NotificationManager.RequestAccess();
|
||||
|
||||
Reference in New Issue
Block a user