From 62cdf40a39239b2ef4f9cd751fecf4d57a6cacd0 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 7 Feb 2019 12:11:16 +0000 Subject: [PATCH] dont assume a user has joined all the rooms in a community --- src/stores/TagOrderStore.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stores/TagOrderStore.js b/src/stores/TagOrderStore.js index 8ecc47d430..92c48fe206 100644 --- a/src/stores/TagOrderStore.js +++ b/src/stores/TagOrderStore.js @@ -180,7 +180,10 @@ class TagOrderStore extends Store { const client = MatrixClientPeg.get(); const changedBadges = {}; groupIds.forEach(groupId => { - const rooms = GroupStore.getGroupRooms(groupId).map(r => client.getRoom(r.roomId)); + const rooms = + GroupStore.getGroupRooms(groupId) + .map(r => client.getRoom(r.roomId)) // to Room objects + .filter(r => !!r); // filter out rooms we haven't joined from the group const badge = rooms && RoomNotifs.aggregateNotificationCount(rooms); changedBadges[groupId] = (badge && badge.count !== 0) ? badge : undefined; });