Skip to content

Commit

Permalink
include account alias in desktop notification if not empty, closes #280
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed Apr 16, 2020
1 parent aa4b731 commit 04fc659
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/web/browser-window/app/_accounts/account.component.ts
Expand Up @@ -213,7 +213,7 @@ export class AccountComponent extends NgChangesObservableComponent implements On
withLatestFrom(this.store.pipe(select(OptionsSelectors.CONFIG.unreadNotifications))),
filter(([, unreadNotifications]) => Boolean(unreadNotifications)),
map(([account]) => account),
map((account) => ({login: account.accountConfig.login, unread: account.notifications.unread})),
map(({accountConfig: {login, title}, notifications: {unread}}) => ({login, title, unread})),
pairwise(),
filter(([prev, curr]) => curr.unread > prev.unread),
map(([, curr]) => curr),
Expand All @@ -223,12 +223,12 @@ export class AccountComponent extends NgChangesObservableComponent implements On
),
),
)
.subscribe(([{login, unread}, trayIconDataURL]) => {
.subscribe(([{login, unread, title}, trayIconDataURL]) => {
new Notification(
PRODUCT_NAME,
{
icon: trayIconDataURL,
body: `Account [${this.componentIndex}]: ${unread} unread message${unread > 1 ? "s" : ""}.`,
body: `Account [${title || this.componentIndex}]: ${unread} unread message${unread > 1 ? "s" : ""}.`,
},
).onclick = () => this.zone.run(() => {
this.onDispatchInLoggerZone(ACCOUNTS_ACTIONS.Select({login}));
Expand Down

0 comments on commit 04fc659

Please sign in to comment.