Better logic for checking if channel has loaded

This commit is contained in:
Reed Garmsen
2015-07-10 11:48:52 -07:00
parent 212a0da5f4
commit 2a1cdc68c8
3 changed files with 9 additions and 2 deletions

View File

@@ -135,6 +135,8 @@ func createUser(c *Context, w http.ResponseWriter, r *http.Request) {
user.EmailVerified = true
}
user.EmailVerified = true
ruser := CreateUser(c, team, user)
if c.Err != nil {
return

View File

@@ -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>

View File

@@ -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) {