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

Commit 65f351f

Browse files
committed
Clear Lifecycle.RtsClient on MatrixChat.mount
- otherwise it ends up sitting around and failing later tests.
1 parent 9ff52b1 commit 65f351f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Lifecycle.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,11 @@ function _handleRestoreFailure(e) {
265265

266266
let rtsClient = null;
267267
export function initRtsClient(url) {
268-
rtsClient = new RtsClient(url);
268+
if (url) {
269+
rtsClient = new RtsClient(url);
270+
} else {
271+
rtsClient = null;
272+
}
269273
}
270274

271275
/**

src/components/structures/MatrixChat.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,8 @@ module.exports = React.createClass({
263263
window.addEventListener('resize', this.handleResize);
264264
this.handleResize();
265265

266-
if (this.props.config.teamServerConfig &&
267-
this.props.config.teamServerConfig.teamServerURL
268-
) {
269-
Lifecycle.initRtsClient(this.props.config.teamServerConfig.teamServerURL);
270-
}
266+
const teamServerConfig = this.props.config.teamServerConfig || {};
267+
Lifecycle.initRtsClient(teamServerConfig.teamServerURL);
271268

272269
// if the user has followed a login or register link, don't reanimate
273270
// the old creds, but rather go straight to the relevant page

0 commit comments

Comments
 (0)