From 64bb6d2b1fffdf33c34fb08a261bccd841cfd621 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 7 Feb 2019 14:41:19 +0000 Subject: [PATCH 1/2] dont remove tags prop from state on logout as we assume its always there --- src/stores/CustomRoomTagStore.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stores/CustomRoomTagStore.js b/src/stores/CustomRoomTagStore.js index 1983fa7462..d898b5d32a 100644 --- a/src/stores/CustomRoomTagStore.js +++ b/src/stores/CustomRoomTagStore.js @@ -113,7 +113,8 @@ class CustomRoomTagStore extends EventEmitter { } break; case 'on_logged_out': { - this._state = {}; + // we assume to always have a tags object in the state + this._state = {tags: {}}; if (this._roomListStoreToken) { this._roomListStoreToken.remove(); this._roomListStoreToken = null; From d2ac4345459aa2f885a8b25e59186b4fc65e9bb2 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 7 Feb 2019 14:41:39 +0000 Subject: [PATCH 2/2] no need to update tags when app is booting, wait till sync --- src/stores/CustomRoomTagStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/CustomRoomTagStore.js b/src/stores/CustomRoomTagStore.js index d898b5d32a..3e109aef2d 100644 --- a/src/stores/CustomRoomTagStore.js +++ b/src/stores/CustomRoomTagStore.js @@ -48,7 +48,7 @@ class CustomRoomTagStore extends EventEmitter { constructor() { super(); // Initialise state - this._state = {tags: this._getUpdatedTags()}; + this._state = {tags: {}}; this._roomListStoreToken = RoomListStore.addListener(() => { this._setState({tags: this._getUpdatedTags()});