Skip to content

Commit

Permalink
fix missing filter for indirectMessageBadge
Browse files Browse the repository at this point in the history
  • Loading branch information
adlk committed Dec 1, 2017
1 parent 893a9f6 commit 3ccbcf5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/stores/ServicesStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,15 +491,13 @@ export default class ServicesStore extends Store {
const showMessageBadgeWhenMuted = this.stores.settings.all.showMessageBadgeWhenMuted;
const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted;

// TODO: unfinished monkey business

const unreadDirectMessageCount = this.enabled
.filter(s => (showMessageBadgeWhenMuted || s.isNotificationEnabled) && showMessageBadgesEvenWhenMuted)
.map(s => s.unreadDirectMessageCount)
.reduce((a, b) => a + b, 0);

const unreadIndirectMessageCount = this.enabled
// .filter(s => s.isIndirectMessageBadgeEnabled && (s.isNotificationEnabled && showMessageBadgeWhenMuted))
.filter(s => (showMessageBadgeWhenMuted || s.isIndirectMessageBadgeEnabled) && showMessageBadgesEvenWhenMuted)
.map(s => s.unreadIndirectMessageCount)
.reduce((a, b) => a + b, 0);

Expand Down

0 comments on commit 3ccbcf5

Please sign in to comment.