disabling avatar notifications functionnal

This commit is contained in:
Nicolas Constant 2019-11-16 17:40:49 -05:00
parent d7d1952c5e
commit 6eb3e44923
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 11 additions and 6 deletions

View File

@ -133,11 +133,16 @@ export class LeftSideBarComponent implements OnInit, OnDestroy {
}); });
this.notificationSub = this.userNotificationServiceService.userNotifications.subscribe((notifications: UserNotification[]) => { this.notificationSub = this.userNotificationServiceService.userNotifications.subscribe((notifications: UserNotification[]) => {
const settings = this.toolsService.getSettings();
notifications.forEach((notification: UserNotification) => { notifications.forEach((notification: UserNotification) => {
const acc = this.accounts.find(x => x.info.id === notification.account.id); const acc = this.accounts.find(x => x.info.id === notification.account.id);
if (acc) { if (acc) {
const accSettings = settings.accountSettings.find(x => x.accountId === acc.info.id);
if (!settings.disableAvatarNotifications && !accSettings.disableAvatarNotifications) {
acc.hasActivityNotifications = notification.hasNewMentions || notification.hasNewNotifications; acc.hasActivityNotifications = notification.hasNewMentions || notification.hasNewNotifications;
} }
}
}); });
}); });