From 893a9f6d9a1bcdbbfe925e718b2c907dcceaa64e Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 1 Dec 2017 12:26:41 +0100 Subject: feat(App): Add option to show/hide notification badges for muted services (@maximiliancsuk) --- src/stores/AppStore.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/stores/AppStore.js') diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 0cfe08a28..6125a7cff 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js @@ -67,6 +67,7 @@ export default class AppStore extends Store { this._setLocale.bind(this), this._handleMiner.bind(this), this._handleMinerThrottle.bind(this), + this._muteAppHandler.bind(this), ]); } @@ -300,6 +301,14 @@ export default class AppStore extends Store { } } + _muteAppHandler() { + const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; + + if (!showMessageBadgesEvenWhenMuted) { + this.actions.app.setBadge({ unreadDirectMessageCount: 0, unreadIndirectMessageCount: 0 }); + } + } + // Helpers async _appStartsCounter() { // we need to wait until the settings request is resolved -- cgit v1.2.3-70-g09d2