Gestito notificationData nelle notifiche push
This commit is contained in:
@@ -77,11 +77,11 @@
|
||||
[JSInvokable]
|
||||
public async Task Delete(string id)
|
||||
{
|
||||
Loading = true;
|
||||
_ = InvokeAsync(StateHasChanged);
|
||||
|
||||
if (!long.TryParse(id, out var notificationId)) return;
|
||||
|
||||
Loading = true;
|
||||
StateHasChanged();
|
||||
|
||||
var removed = false;
|
||||
|
||||
if (Notification.ReceivedNotifications.RemoveAll(x => x.Id == notificationId) > 0)
|
||||
@@ -91,16 +91,18 @@
|
||||
else if (Notification.NotificationsRead.RemoveAll(x => x.Id == notificationId) > 0)
|
||||
removed = true;
|
||||
|
||||
if (!removed) return;
|
||||
if (!removed)
|
||||
{
|
||||
Loading = false;
|
||||
StateHasChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
await IntegryNotificationRestClient.Delete(notificationId);
|
||||
|
||||
NotificationService.OrderNotificationList();
|
||||
Loading = false;
|
||||
_ = InvokeAsync(StateHasChanged);
|
||||
|
||||
_ = Task.Run(() =>
|
||||
{
|
||||
_ = IntegryNotificationRestClient.Delete(notificationId);
|
||||
});
|
||||
StateHasChanged();
|
||||
|
||||
Messenger.Send(new NotificationsLoadedMessage());
|
||||
}
|
||||
@@ -109,7 +111,7 @@
|
||||
public async Task MarkAsRead(string id)
|
||||
{
|
||||
Loading = true;
|
||||
_ = InvokeAsync(StateHasChanged);
|
||||
StateHasChanged();
|
||||
|
||||
var notificationId = long.Parse(id);
|
||||
|
||||
|
||||
@@ -47,11 +47,11 @@
|
||||
Notification.StartDate < DateTime.Today && Notification.Body != null && Notification.Body.Contains("Oggi")
|
||||
)
|
||||
{
|
||||
<MudText Typo="Typo.caption" Class="subtitle">@Notification.Body.Replace("Oggi", $"{Notification.StartDate:d}")</MudText>
|
||||
<div class="subtitle">@Notification.Body.Replace("Oggi", $"{Notification.StartDate:d}")</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudText Typo="Typo.caption" Class="subtitle">@Notification.Body</MudText>
|
||||
<div class="subtitle">@Notification.Body</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -105,4 +105,6 @@
|
||||
.notification-body ::deep > .subtitle {
|
||||
font-size: 12px;
|
||||
color: var(--mud-palette-drawer-text);
|
||||
line-height: inherit;
|
||||
margin-top: .5rem;
|
||||
}
|
||||
Reference in New Issue
Block a user