You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-19 05:22:13 +03:00
Split updatedSelectedTagsRooms
because we don't need to get the rooms for all groups when the filtered tags change.
This commit is contained in:
@@ -102,11 +102,12 @@ module.exports = React.createClass({
|
|||||||
this._groupStores[tag] = GroupStoreCache.getGroupStore(tag);
|
this._groupStores[tag] = GroupStoreCache.getGroupStore(tag);
|
||||||
this._groupStores[tag].registerListener(() => {
|
this._groupStores[tag].registerListener(() => {
|
||||||
// This group's rooms or members may have updated, update rooms for its tag
|
// This group's rooms or members may have updated, update rooms for its tag
|
||||||
this.updateSelectedTagsRooms(dmRoomMap, [tag]);
|
this.updateSelectedTagsRoomsForGroups(dmRoomMap, tag);
|
||||||
|
this.updateSelectedTagsRooms();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// Filters themselves have changed, refresh the selected tags
|
// Filters themselves have changed, refresh the selected tags
|
||||||
this.updateSelectedTagsRooms(dmRoomMap, FilterStore.getSelectedTags());
|
this.updateSelectedTagsRooms();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.refreshRoomList();
|
this.refreshRoomList();
|
||||||
@@ -269,9 +270,8 @@ module.exports = React.createClass({
|
|||||||
}, 500),
|
}, 500),
|
||||||
|
|
||||||
// Update which rooms and users should appear in RoomList as dictated by selected tags
|
// Update which rooms and users should appear in RoomList as dictated by selected tags
|
||||||
updateSelectedTagsRooms: function(dmRoomMap, updatedTags) {
|
updateSelectedTagsRoomsForGroups: function(dmRoomMap, tag) {
|
||||||
if (!this.mounted) return;
|
if (!this.mounted) return;
|
||||||
updatedTags.forEach((tag) => {
|
|
||||||
// For now, only handle group tags
|
// For now, only handle group tags
|
||||||
const store = this._groupStores[tag];
|
const store = this._groupStores[tag];
|
||||||
if (!store) return;
|
if (!store) return;
|
||||||
@@ -285,8 +285,9 @@ module.exports = React.createClass({
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
// TODO: Check if room has been tagged to the group by the user
|
// TODO: Check if room has been tagged to the group by the user
|
||||||
});
|
},
|
||||||
|
|
||||||
|
updateSelectedTagsRooms: function() {
|
||||||
this._selectedTagsRoomIds = [];
|
this._selectedTagsRoomIds = [];
|
||||||
FilterStore.getSelectedTags().forEach((tag) => {
|
FilterStore.getSelectedTags().forEach((tag) => {
|
||||||
(this._selectedTagsRoomIdsForGroup[tag] || []).forEach(
|
(this._selectedTagsRoomIdsForGroup[tag] || []).forEach(
|
||||||
|
|||||||
Reference in New Issue
Block a user