diff --git a/apps/red-ui/src/app/components/notifications/notifications.component.html b/apps/red-ui/src/app/components/notifications/notifications.component.html
index 3b2f42e76..8c739086f 100644
--- a/apps/red-ui/src/app/components/notifications/notifications.component.html
+++ b/apps/red-ui/src/app/components/notifications/notifications.component.html
@@ -11,7 +11,11 @@
>
-
{{ group.date }}
+
+
{{ group.date }}
+
View all
+
+
{
+ $event.stopPropagation();
+ const notifications = await this._notificationsService.getNotifications(false).toPromise();
+ await this._readNotifications(notifications);
+ await this._loadData();
+ }
+
async markRead(notification: Notification, $event, isRead = true): Promise {
$event.stopPropagation();
await this._notificationsService.toggleNotificationRead([notification.id], isRead).toPromise();
await this._loadData();
}
+ private async _readNotifications(notifications: Notification[]): Promise {
+ for (const notification of notifications) {
+ await this._notificationsService.toggleNotificationRead([notification.id], true).toPromise();
+ }
+ }
+
private async _loadData(): Promise {
const notifications = await this._notificationsService.getNotifications(false).toPromise();
this._notifications$.next(notifications);