calculate badges for communities in TagOrderStore

This commit is contained in:
Bruno Windels
2019-02-06 14:29:40 +00:00
parent 97db9cd99e
commit a222ee33df
2 changed files with 38 additions and 0 deletions
+8
View File
@@ -203,6 +203,14 @@ class GroupStore extends EventEmitter {
return this._ready[id][groupId];
}
getGroupIdsForRoomId(roomId) {
const groupIds = Object.keys(this._state[this.STATE_KEY.GroupRooms]);
return groupIds.filter(groupId => {
const rooms = this._state[this.STATE_KEY.GroupRooms][groupId] || [];
return rooms.some(room => room.roomId === roomId);
});
}
getSummary(groupId) {
return this._state[this.STATE_KEY.Summary][groupId] || {};
}