Skip to content

Commit 17328ca

Browse files
committed
Do not take conversations having isArchived into account
Signed-off-by: Markus Stoll <[email protected]>
1 parent 0c50603 commit 17328ca

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/App.vue

+14-6
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,29 @@ export default {
9696

9797
computed: {
9898
getTotalUnreadMessages() {
99-
return this.$store.getters.conversationsList.reduce((total, conversation) => {
100-
return total + (conversation.unreadMessages || 0);
101-
}, 0);
99+
return this.$store.getters.conversationsList
100+
.filter(conversation => !conversation.isArchived)
101+
.reduce((total, conversation) => {
102+
return total + (conversation.unreadMessages || 0);
103+
}, 0);
102104
},
103105

104106
getTotalUnreadMentions() {
105-
return this.$store.getters.conversationsList.filter(conversation => conversation.unreadMention).length;
107+
return this.$store.getters.conversationsList
108+
.filter(conversation => !conversation.isArchived && conversation.unreadMention)
109+
.length;
106110
},
107111

108112
getTotalUnreadMentionsDirect() {
109-
return this.$store.getters.conversationsList.filter(conversation => conversation.unreadMentionDirect).length;
113+
return this.$store.getters.conversationsList
114+
.filter(conversation => !conversation.isArchived && conversation.unreadMentionDirect)
115+
.length;
110116
},
111117

112118
getUnreadConversationCount() {
113-
return this.$store.getters.conversationsList.filter(conversation => (conversation.unreadMessages || 0) > 0).length;
119+
return this.$store.getters.conversationsList
120+
.filter(conversation => !conversation.isArchived && (conversation.unreadMessages || 0) > 0)
121+
.length;
114122
},
115123

116124
getUserId() {

0 commit comments

Comments
 (0)