mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Remove non-functional session load error
MatrixChat was trying to display an error if the session failed to restore, but it was never actually being shown because it was just set as a member variable and therefore never actually caused a re-render for the error to be displayed. Almost all errors are caught by _restoreFromLocalStorage which displays the fancy dialog if your session can't be restored, so I'm not convinced this ever even tried to do anything anyway. Remove it.
This commit is contained in:
parent
cee2628b41
commit
a6612bb8ad
@ -194,9 +194,6 @@ module.exports = React.createClass({
|
|||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
SdkConfig.put(this.props.config);
|
SdkConfig.put(this.props.config);
|
||||||
|
|
||||||
// if the automatic session load failed, the error
|
|
||||||
this.sessionLoadError = null;
|
|
||||||
|
|
||||||
if (this.props.config.sync_timeline_limit) {
|
if (this.props.config.sync_timeline_limit) {
|
||||||
MatrixClientPeg.opts.initialSyncLimit = this.props.config.sync_timeline_limit;
|
MatrixClientPeg.opts.initialSyncLimit = this.props.config.sync_timeline_limit;
|
||||||
}
|
}
|
||||||
@ -285,7 +282,6 @@ module.exports = React.createClass({
|
|||||||
});
|
});
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.error("Unable to load session", e);
|
console.error("Unable to load session", e);
|
||||||
this.sessionLoadError = e.message;
|
|
||||||
}).done(()=>{
|
}).done(()=>{
|
||||||
// stuff this through the dispatcher so that it happens
|
// stuff this through the dispatcher so that it happens
|
||||||
// after the on_logged_in action.
|
// after the on_logged_in action.
|
||||||
@ -1240,7 +1236,7 @@ module.exports = React.createClass({
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
const Login = sdk.getComponent('structures.login.Login');
|
const Login = sdk.getComponent('structures.login.Login');
|
||||||
var r = (
|
return (
|
||||||
<Login
|
<Login
|
||||||
onLoggedIn={Lifecycle.setLoggedIn}
|
onLoggedIn={Lifecycle.setLoggedIn}
|
||||||
onRegisterClick={this.onRegisterClick}
|
onRegisterClick={this.onRegisterClick}
|
||||||
@ -1253,16 +1249,8 @@ module.exports = React.createClass({
|
|||||||
onForgotPasswordClick={this.onForgotPasswordClick}
|
onForgotPasswordClick={this.onForgotPasswordClick}
|
||||||
enableGuest={this.props.enableGuest}
|
enableGuest={this.props.enableGuest}
|
||||||
onCancelClick={this.state.guestCreds ? this.onReturnToGuestClick : null}
|
onCancelClick={this.state.guestCreds ? this.onReturnToGuestClick : null}
|
||||||
initialErrorText={this.sessionLoadError}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
// we only want to show the session load error the first time the
|
|
||||||
// Login component is rendered. This is pretty hacky but I can't
|
|
||||||
// think of another way to achieve it.
|
|
||||||
this.sessionLoadError = null;
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -53,14 +53,12 @@ module.exports = React.createClass({
|
|||||||
// login shouldn't care how password recovery is done.
|
// login shouldn't care how password recovery is done.
|
||||||
onForgotPasswordClick: React.PropTypes.func,
|
onForgotPasswordClick: React.PropTypes.func,
|
||||||
onCancelClick: React.PropTypes.func,
|
onCancelClick: React.PropTypes.func,
|
||||||
|
|
||||||
initialErrorText: React.PropTypes.string,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialState: function() {
|
getInitialState: function() {
|
||||||
return {
|
return {
|
||||||
busy: false,
|
busy: false,
|
||||||
errorText: this.props.initialErrorText,
|
errorText: null,
|
||||||
loginIncorrect: false,
|
loginIncorrect: false,
|
||||||
enteredHomeserverUrl: this.props.customHsUrl || this.props.defaultHsUrl,
|
enteredHomeserverUrl: this.props.customHsUrl || this.props.defaultHsUrl,
|
||||||
enteredIdentityServerUrl: this.props.customIsUrl || this.props.defaultIsUrl,
|
enteredIdentityServerUrl: this.props.customIsUrl || this.props.defaultIsUrl,
|
||||||
|
Loading…
Reference in New Issue
Block a user