You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Use the already available state for checking if custom tags are enabled
This commit is contained in:
@@ -529,15 +529,6 @@ class RoomListStore extends Store {
|
|||||||
|
|
||||||
const dmRoomMap = DMRoomMap.shared();
|
const dmRoomMap = DMRoomMap.shared();
|
||||||
|
|
||||||
// Speed optimization: Hitting the SettingsStore is expensive, so avoid that at all costs.
|
|
||||||
let _isCustomTagsEnabled = null;
|
|
||||||
const isCustomTagsEnabled = () => {
|
|
||||||
if (_isCustomTagsEnabled === null) {
|
|
||||||
_isCustomTagsEnabled = SettingsStore.isFeatureEnabled("feature_custom_tags");
|
|
||||||
}
|
|
||||||
return _isCustomTagsEnabled;
|
|
||||||
};
|
|
||||||
|
|
||||||
this._matrixClient.getRooms().forEach((room) => {
|
this._matrixClient.getRooms().forEach((room) => {
|
||||||
const myUserId = this._matrixClient.getUserId();
|
const myUserId = this._matrixClient.getUserId();
|
||||||
const membership = room.getMyMembership();
|
const membership = room.getMyMembership();
|
||||||
@@ -553,7 +544,7 @@ class RoomListStore extends Store {
|
|||||||
tagNames = tagNames.filter((t) => {
|
tagNames = tagNames.filter((t) => {
|
||||||
// Speed optimization: Avoid hitting the SettingsStore at all costs by making it the
|
// Speed optimization: Avoid hitting the SettingsStore at all costs by making it the
|
||||||
// last condition possible.
|
// last condition possible.
|
||||||
return lists[t] !== undefined || (!t.startsWith('m.') && isCustomTagsEnabled());
|
return lists[t] !== undefined || (!t.startsWith('m.') && this._state.tagsEnabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (tagNames.length) {
|
if (tagNames.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user