You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-20 16:22:28 +03:00
Remove a factor n complexity during room visibility calc
This commit is contained in:
@@ -352,6 +352,14 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
const filteredLists = {};
|
const filteredLists = {};
|
||||||
|
|
||||||
|
const isRoomVisible = {
|
||||||
|
// $roomId: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
this._visibleRooms.forEach((r) => {
|
||||||
|
isRoomVisible[r.roomId] = true;
|
||||||
|
});
|
||||||
|
|
||||||
Object.keys(lists).forEach((tagName) => {
|
Object.keys(lists).forEach((tagName) => {
|
||||||
filteredLists[tagName] = lists[tagName].filter((taggedRoom) => {
|
filteredLists[tagName] = lists[tagName].filter((taggedRoom) => {
|
||||||
// Somewhat impossible, but guard against it anyway
|
// Somewhat impossible, but guard against it anyway
|
||||||
@@ -363,9 +371,7 @@ module.exports = React.createClass({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this._visibleRooms.some((visibleRoom) => {
|
return isRoomVisible[taggedRoom.roomId];
|
||||||
return visibleRoom.roomId === taggedRoom.roomId;
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user