disabling avatar notifications functionnal
This commit is contained in:
parent
d7d1952c5e
commit
6eb3e44923
|
@ -79,23 +79,23 @@ export class LeftSideBarComponent implements OnInit, OnDestroy {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private selectPreviousAccount(){
|
private selectPreviousAccount() {
|
||||||
let accounts = <AccountInfo[]>this.store.snapshot().registeredaccounts.accounts;
|
let accounts = <AccountInfo[]>this.store.snapshot().registeredaccounts.accounts;
|
||||||
let selectedAccount = accounts.find(x => x.isSelected);
|
let selectedAccount = accounts.find(x => x.isSelected);
|
||||||
let selectedIndex = accounts.indexOf(selectedAccount);
|
let selectedIndex = accounts.indexOf(selectedAccount);
|
||||||
|
|
||||||
if(selectedIndex > 0){
|
if (selectedIndex > 0) {
|
||||||
let previousAccount = accounts[selectedIndex - 1];
|
let previousAccount = accounts[selectedIndex - 1];
|
||||||
this.store.dispatch([new SelectAccount(previousAccount)]);
|
this.store.dispatch([new SelectAccount(previousAccount)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private selectNextAccount(){
|
private selectNextAccount() {
|
||||||
let accounts = <AccountInfo[]>this.store.snapshot().registeredaccounts.accounts;
|
let accounts = <AccountInfo[]>this.store.snapshot().registeredaccounts.accounts;
|
||||||
let selectedAccount = accounts.find(x => x.isSelected);
|
let selectedAccount = accounts.find(x => x.isSelected);
|
||||||
let selectedIndex = accounts.indexOf(selectedAccount);
|
let selectedIndex = accounts.indexOf(selectedAccount);
|
||||||
|
|
||||||
if(selectedIndex < accounts.length - 1){
|
if (selectedIndex < accounts.length - 1) {
|
||||||
let nextAccount = accounts[selectedIndex + 1];
|
let nextAccount = accounts[selectedIndex + 1];
|
||||||
this.store.dispatch([new SelectAccount(nextAccount)]);
|
this.store.dispatch([new SelectAccount(nextAccount)]);
|
||||||
}
|
}
|
||||||
|
@ -133,10 +133,15 @@ 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) {
|
||||||
acc.hasActivityNotifications = notification.hasNewMentions || notification.hasNewNotifications;
|
const accSettings = settings.accountSettings.find(x => x.accountId === acc.info.id);
|
||||||
|
if (!settings.disableAvatarNotifications && !accSettings.disableAvatarNotifications) {
|
||||||
|
acc.hasActivityNotifications = notification.hasNewMentions || notification.hasNewNotifications;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue