From aa914098dc4f1ec343cdbbf3be34a7c73386776c Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Mon, 11 Dec 2017 17:19:29 +0000 Subject: [PATCH] Return null if TagOrderStore is loading The view should decide the default state. --- src/components/structures/TagPanel.js | 2 +- src/stores/TagOrderStore.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/TagPanel.js b/src/components/structures/TagPanel.js index 88bb39406e..59a658c1b4 100644 --- a/src/components/structures/TagPanel.js +++ b/src/components/structures/TagPanel.js @@ -58,7 +58,7 @@ const TagPanel = React.createClass({ return; } - const orderedTags = TagOrderStore.getOrderedTags(); + const orderedTags = TagOrderStore.getOrderedTags() || []; const orderedGroupTags = orderedTags.filter((t) => t[0] === '+'); Promise.all(orderedGroupTags.map( (groupId) => FlairStore.getGroupProfileCached(this.context.matrixClient, groupId), diff --git a/src/stores/TagOrderStore.js b/src/stores/TagOrderStore.js index 9741d59d4e..108eb434a2 100644 --- a/src/stores/TagOrderStore.js +++ b/src/stores/TagOrderStore.js @@ -94,7 +94,7 @@ class TagOrderStore extends Store { _updateOrderedTags() { this._setState({ orderedTags: this._state.hasSynced && this._state.hasFetchedJoinedGroups ? - this._state.orderedTagsAccountData || this._state.joinedGroupIds : [], + this._state.orderedTagsAccountData || this._state.joinedGroupIds : null, }); }