diff options
author | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-07-10 11:48:52 -0700 |
---|---|---|
committer | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-07-10 11:48:52 -0700 |
commit | 2a1cdc68c8639ae21b00f29fa372359489cfedcc (patch) | |
tree | 4b0c1b24dbe75eecc9805b8b5e4c561f62a2262c /web | |
parent | 212a0da5f47a6f85eb0556258ead5f07fe9497c2 (diff) | |
download | chat-2a1cdc68c8639ae21b00f29fa372359489cfedcc.tar.gz chat-2a1cdc68c8639ae21b00f29fa372359489cfedcc.tar.bz2 chat-2a1cdc68c8639ae21b00f29fa372359489cfedcc.zip |
Better logic for checking if channel has loaded
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/more_channels.jsx | 2 | ||||
-rw-r--r-- | web/react/stores/channel_store.jsx | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/web/react/components/more_channels.jsx b/web/react/components/more_channels.jsx index 1af259853..c3ddc76f3 100644 --- a/web/react/components/more_channels.jsx +++ b/web/react/components/more_channels.jsx @@ -79,7 +79,7 @@ module.exports = React.createClass({ <button data-toggle="modal" data-target="#new_channel" data-channeltype={this.state.channel_type} type="button" className="btn btn-primary channel-create-btn" onClick={this.handleNewChannel}>Create New Channel</button> </div> <div className="modal-body"> - {moreChannels ? + {!moreChannels.loading ? (moreChannels.length ? <table className="more-channel-table table"> <tbody> diff --git a/web/react/stores/channel_store.jsx b/web/react/stores/channel_store.jsx index f6b8fecd4..4429a5312 100644 --- a/web/react/stores/channel_store.jsx +++ b/web/react/stores/channel_store.jsx @@ -202,13 +202,18 @@ var ChannelStore = assign({}, EventEmitter.prototype, { BrowserStore.setItem("more_channels", JSON.stringify(channels)); }, _getMoreChannels: function() { - var channels; + var channels = null; try { channels = JSON.parse(BrowserStore.getItem("more_channels")); } catch (err) { } + if (channels == null) { + channels = {}; + channels.loading = true; + } + return channels; }, _storeExtraInfos: function(extraInfos) { |