diff --git a/src/app/services/user-notification.service.ts b/src/app/services/user-notification.service.ts index ab7be46..d4ab5ba 100644 --- a/src/app/services/user-notification.service.ts +++ b/src/app/services/user-notification.service.ts @@ -36,23 +36,20 @@ export class UserNotificationService { ); } - public updateUnreadNotifications(): void { - this.apiService.getUnreadNotifications().subscribe((notifications) => { - this._userNotifications.next(notifications); - }); - } - - public addNotification(notification: UserNotification): void { - this.insertNotification(notification); - } - public markAllAsRead(): void { - this.apiService.markAllAsRead().subscribe(); + public updateUnreadNotifications(): void { + this.apiService.getUnreadNotifications().subscribe((notifications) => { + this._userNotifications.next(notifications); + }); } public addNotification(notification: UserNotification): void { this.insertNotification(notification); } + public markAllAsRead(): void { + this.apiService.markAllAsRead().subscribe(); + } + private insertNotification(notification: UserNotification): void { if (notification.created_at == null) { notification.created_at = dayjs().format('YYYY-MM-DD HH:mm:ss'); @@ -78,7 +75,8 @@ export class UserNotificationService { } private markAsRead(notification: UserNotification): void { - if (notification.type === UserNotificationType.SwUpdate || notification.type === UserNotificationType.TestSocket) { + if (notification.type === UserNotificationType.SwUpdate + || notification.type === UserNotificationType.TestSocket) { this.removeNotification(notification); return; }