Better logic for checking if channel has loaded

Этот коммит содержится в:
Reed Garmsen
2015-07-10 11:48:52 -07:00
родитель 212a0da5f4
Коммит 2a1cdc68c8
3 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

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

Просмотреть файл

@@ -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> <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>
<div className="modal-body"> <div className="modal-body">
{moreChannels ? {!moreChannels.loading ?
(moreChannels.length ? (moreChannels.length ?
<table className="more-channel-table table"> <table className="more-channel-table table">
<tbody> <tbody>

Просмотреть файл

@@ -202,13 +202,18 @@ var ChannelStore = assign({}, EventEmitter.prototype, {
BrowserStore.setItem("more_channels", JSON.stringify(channels)); BrowserStore.setItem("more_channels", JSON.stringify(channels));
}, },
_getMoreChannels: function() { _getMoreChannels: function() {
var channels; var channels = null;
try { try {
channels = JSON.parse(BrowserStore.getItem("more_channels")); channels = JSON.parse(BrowserStore.getItem("more_channels"));
} }
catch (err) { catch (err) {
} }
if (channels == null) {
channels = {};
channels.loading = true;
}
return channels; return channels;
}, },
_storeExtraInfos: function(extraInfos) { _storeExtraInfos: function(extraInfos) {