Migliorata gestione e visualizzazione notifiche

This commit is contained in:
2025-09-12 15:42:56 +02:00
parent b798b01da0
commit 223e74c490
20 changed files with 229 additions and 60 deletions

View File

@@ -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();