From 872cdaa9b35e86fc71a56ecee143015ecc772ca6 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 28 Feb 2019 14:03:03 -0700 Subject: [PATCH] Use the already available state for checking if custom tags are enabled --- src/stores/RoomListStore.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/stores/RoomListStore.js b/src/stores/RoomListStore.js index 292f7beb98..a4138fcf01 100644 --- a/src/stores/RoomListStore.js +++ b/src/stores/RoomListStore.js @@ -529,15 +529,6 @@ class RoomListStore extends Store { 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) => { const myUserId = this._matrixClient.getUserId(); const membership = room.getMyMembership(); @@ -553,7 +544,7 @@ class RoomListStore extends Store { tagNames = tagNames.filter((t) => { // Speed optimization: Avoid hitting the SettingsStore at all costs by making it the // last condition possible. - return lists[t] !== undefined || (!t.startsWith('m.') && isCustomTagsEnabled()); + return lists[t] !== undefined || (!t.startsWith('m.') && this._state.tagsEnabled); }); if (tagNames.length) {