Clear Lifecycle.RtsClient on MatrixChat.mount

- otherwise it ends up sitting around and failing later tests.
This commit is contained in:
Richard van der Hoff 2017-06-15 02:15:13 +01:00
parent 9ff52b182f
commit 65f351ff22
2 changed files with 7 additions and 6 deletions

View File

@ -265,7 +265,11 @@ function _handleRestoreFailure(e) {
let rtsClient = null;
export function initRtsClient(url) {
rtsClient = new RtsClient(url);
if (url) {
rtsClient = new RtsClient(url);
} else {
rtsClient = null;
}
}
/**

View File

@ -263,11 +263,8 @@ module.exports = React.createClass({
window.addEventListener('resize', this.handleResize);
this.handleResize();
if (this.props.config.teamServerConfig &&
this.props.config.teamServerConfig.teamServerURL
) {
Lifecycle.initRtsClient(this.props.config.teamServerConfig.teamServerURL);
}
const teamServerConfig = this.props.config.teamServerConfig || {};
Lifecycle.initRtsClient(teamServerConfig.teamServerURL);
// if the user has followed a login or register link, don't reanimate
// the old creds, but rather go straight to the relevant page