Skip to content

Commit 2802253

Browse files
committed
Fix the client-peg clean up to match the changes vector has made to the sdk
1 parent d8494ff commit 2802253

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎src/MatrixClientPeg.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ module.exports = {
4949
return matrixClient;
5050
},
5151

52+
unset: function() {
53+
matrixClient = null;
54+
},
55+
5256
replaceUsingUrls: function(hs_url, is_url) {
5357
matrixClient = Matrix.createClient({
5458
baseUrl: hs_url,

‎src/controllers/pages/MatrixChat.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ module.exports = {
9090
}
9191
Notifier.stop();
9292
MatrixClientPeg.get().removeAllListeners();
93-
MatrixClientPeg.replace(null);
93+
MatrixClientPeg.unset();
9494
break;
9595
case 'start_registration':
9696
if (this.state.logged_in) return;

‎src/controllers/templates/Login.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ module.exports = {
7676
'password': formVals.password
7777
}).done(function(data) {
7878
MatrixClientPeg.replaceUsingAccessToken(
79-
that.state.hs_url, that.state.is_url,
79+
self.state.hs_url, self.state.is_url,
8080
data.user_id, data.access_token
8181
);
82-
if (that.props.onLoggedIn) {
83-
that.props.onLoggedIn();
82+
if (self.props.onLoggedIn) {
83+
self.props.onLoggedIn();
8484
}
8585
}, function(error) {
8686
self.setStep("stage_m.login.password");

0 commit comments

Comments
 (0)