diff options
author | 2017-12-14 17:09:21 +0100 | |
---|---|---|
committer | 2017-12-14 17:09:21 +0100 | |
commit | f8bb2bedba18af4085865209805a2c5373ffb027 (patch) | |
tree | dba21a1c3022ce21fa77596110cc5981131389b6 /src | |
parent | feat(Service): Add option to completely disable message badges (diff) | |
download | ferdium-app-f8bb2bedba18af4085865209805a2c5373ffb027.tar.gz ferdium-app-f8bb2bedba18af4085865209805a2c5373ffb027.tar.zst ferdium-app-f8bb2bedba18af4085865209805a2c5373ffb027.zip |
Add missing commit
Diffstat (limited to 'src')
-rw-r--r-- | src/components/services/tabs/TabItem.js | 2 | ||||
-rw-r--r-- | src/models/Service.js | 3 | ||||
-rw-r--r-- | src/stores/ServicesStore.js | 8 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/components/services/tabs/TabItem.js b/src/components/services/tabs/TabItem.js index 8403d9462..7aed8fda7 100644 --- a/src/components/services/tabs/TabItem.js +++ b/src/components/services/tabs/TabItem.js | |||
@@ -126,7 +126,7 @@ class TabItem extends Component { | |||
126 | const menu = Menu.buildFromTemplate(menuTemplate); | 126 | const menu = Menu.buildFromTemplate(menuTemplate); |
127 | 127 | ||
128 | let notificationBadge = null; | 128 | let notificationBadge = null; |
129 | if ((showMessageBadgeWhenMutedSetting || service.isNotificationEnabled) && showMessageBadgesEvenWhenMuted) { | 129 | if ((showMessageBadgeWhenMutedSetting || service.isNotificationEnabled) && showMessageBadgesEvenWhenMuted && service.isBadgeEnabled) { |
130 | notificationBadge = ( | 130 | notificationBadge = ( |
131 | <span> | 131 | <span> |
132 | {service.unreadDirectMessageCount > 0 && ( | 132 | {service.unreadDirectMessageCount > 0 && ( |
diff --git a/src/models/Service.js b/src/models/Service.js index 820cf4506..0b19440e7 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -53,6 +53,9 @@ export default class Service { | |||
53 | this.isNotificationEnabled = data.isNotificationEnabled !== undefined | 53 | this.isNotificationEnabled = data.isNotificationEnabled !== undefined |
54 | ? data.isNotificationEnabled : this.isNotificationEnabled; | 54 | ? data.isNotificationEnabled : this.isNotificationEnabled; |
55 | 55 | ||
56 | this.isBadgeEnabled = data.isBadgeEnabled !== undefined | ||
57 | ? data.isBadgeEnabled : this.isBadgeEnabled; | ||
58 | |||
56 | this.isIndirectMessageBadgeEnabled = data.isIndirectMessageBadgeEnabled !== undefined | 59 | this.isIndirectMessageBadgeEnabled = data.isIndirectMessageBadgeEnabled !== undefined |
57 | ? data.isIndirectMessageBadgeEnabled : this.isIndirectMessageBadgeEnabled; | 60 | ? data.isIndirectMessageBadgeEnabled : this.isIndirectMessageBadgeEnabled; |
58 | 61 | ||
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index b04aafd78..1cdf06041 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -491,13 +491,13 @@ export default class ServicesStore extends Store { | |||
491 | const showMessageBadgeWhenMuted = this.stores.settings.all.showMessageBadgeWhenMuted; | 491 | const showMessageBadgeWhenMuted = this.stores.settings.all.showMessageBadgeWhenMuted; |
492 | const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; | 492 | const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; |
493 | 493 | ||
494 | const unreadDirectMessageCount = this.enabled | 494 | const unreadDirectMessageCount = this.allDisplayed |
495 | .filter(s => (showMessageBadgeWhenMuted || s.isNotificationEnabled) && showMessageBadgesEvenWhenMuted) | 495 | .filter(s => (showMessageBadgeWhenMuted || s.isNotificationEnabled) && showMessageBadgesEvenWhenMuted && s.isBadgeEnabled) |
496 | .map(s => s.unreadDirectMessageCount) | 496 | .map(s => s.unreadDirectMessageCount) |
497 | .reduce((a, b) => a + b, 0); | 497 | .reduce((a, b) => a + b, 0); |
498 | 498 | ||
499 | const unreadIndirectMessageCount = this.enabled | 499 | const unreadIndirectMessageCount = this.allDisplayed |
500 | .filter(s => (showMessageBadgeWhenMuted || s.isIndirectMessageBadgeEnabled) && showMessageBadgesEvenWhenMuted) | 500 | .filter(s => (showMessageBadgeWhenMuted || s.isIndirectMessageBadgeEnabled) && showMessageBadgesEvenWhenMuted && s.isBadgeEnabled) |
501 | .map(s => s.unreadIndirectMessageCount) | 501 | .map(s => s.unreadIndirectMessageCount) |
502 | .reduce((a, b) => a + b, 0); | 502 | .reduce((a, b) => a + b, 0); |
503 | 503 | ||