fix BrowserStore bug in actionOnItemsWithPrefix and refactor BrowserStore
Этот коммит содержится в:
@@ -17,7 +17,7 @@ module.exports = React.createClass({
|
||||
return;
|
||||
}
|
||||
|
||||
var username_error = utils.isValidUsername(this.state.user.username)
|
||||
var username_error = utils.isValidUsername(this.state.user.username);
|
||||
if (username_error === "Cannot use a reserved word as a username.") {
|
||||
this.setState({name_error: "This username is reserved, please choose a new one.", email_error: "", password_error: "", server_error: ""});
|
||||
return;
|
||||
@@ -53,7 +53,7 @@ module.exports = React.createClass({
|
||||
UserStore.setLastEmail(this.state.user.email);
|
||||
UserStore.setCurrentUser(data);
|
||||
if (this.props.hash > 0)
|
||||
BrowserStore.setGlobalItem(this.props.hash, JSON.stringify({wizard: "finished"}));
|
||||
BrowserStore.setGlobalItem(this.props.hash, {wizard: "finished"});
|
||||
window.location.href = '/channels/town-square';
|
||||
}.bind(this),
|
||||
function(err) {
|
||||
@@ -73,12 +73,7 @@ module.exports = React.createClass({
|
||||
);
|
||||
},
|
||||
getInitialState: function() {
|
||||
var props = null;
|
||||
try {
|
||||
props = JSON.parse(BrowserStore.getGlobalItem(this.props.hash));
|
||||
}
|
||||
catch(parse_error) {
|
||||
}
|
||||
var props = BrowserStore.getGlobalItem(this.props.hash);
|
||||
|
||||
if (!props) {
|
||||
props = {};
|
||||
@@ -91,7 +86,7 @@ module.exports = React.createClass({
|
||||
props.original_email = this.props.email;
|
||||
}
|
||||
|
||||
return props ;
|
||||
return props;
|
||||
},
|
||||
render: function() {
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user