Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit d30ee91

Browse files
authored
Merge pull request #783 from matrix-org/dbkr/remove_session_load_error
Remove non-functional session load error
2 parents 22b0f69 + dff7998 commit d30ee91

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

src/components/structures/MatrixChat.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,6 @@ module.exports = React.createClass({
194194
componentWillMount: function() {
195195
SdkConfig.put(this.props.config);
196196

197-
// if the automatic session load failed, the error
198-
this.sessionLoadError = null;
199-
200197
if (this.props.config.sync_timeline_limit) {
201198
MatrixClientPeg.opts.initialSyncLimit = this.props.config.sync_timeline_limit;
202199
}
@@ -285,7 +282,6 @@ module.exports = React.createClass({
285282
});
286283
}).catch((e) => {
287284
console.error("Unable to load session", e);
288-
this.sessionLoadError = e.message;
289285
}).done(()=>{
290286
// stuff this through the dispatcher so that it happens
291287
// after the on_logged_in action.
@@ -1232,7 +1228,7 @@ module.exports = React.createClass({
12321228
);
12331229
} else {
12341230
const Login = sdk.getComponent('structures.login.Login');
1235-
var r = (
1231+
return (
12361232
<Login
12371233
onLoggedIn={Lifecycle.setLoggedIn}
12381234
onRegisterClick={this.onRegisterClick}
@@ -1245,16 +1241,8 @@ module.exports = React.createClass({
12451241
onForgotPasswordClick={this.onForgotPasswordClick}
12461242
enableGuest={this.props.enableGuest}
12471243
onCancelClick={this.state.guestCreds ? this.onReturnToGuestClick : null}
1248-
initialErrorText={this.sessionLoadError}
12491244
/>
12501245
);
1251-
1252-
// we only want to show the session load error the first time the
1253-
// Login component is rendered. This is pretty hacky but I can't
1254-
// think of another way to achieve it.
1255-
this.sessionLoadError = null;
1256-
1257-
return r;
12581246
}
12591247
}
12601248
});

src/components/structures/login/Login.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,12 @@ module.exports = React.createClass({
5353
// login shouldn't care how password recovery is done.
5454
onForgotPasswordClick: React.PropTypes.func,
5555
onCancelClick: React.PropTypes.func,
56-
57-
initialErrorText: React.PropTypes.string,
5856
},
5957

6058
getInitialState: function() {
6159
return {
6260
busy: false,
63-
errorText: this.props.initialErrorText,
61+
errorText: null,
6462
loginIncorrect: false,
6563
enteredHomeserverUrl: this.props.customHsUrl || this.props.defaultHsUrl,
6664
enteredIdentityServerUrl: this.props.customIsUrl || this.props.defaultIsUrl,

0 commit comments

Comments
 (0)