forked from matrix/element-web
Fix the client-peg clean up to match the changes vector has made to the sdk
This commit is contained in:
parent
d8494ff89b
commit
28022534f7
|
@ -49,6 +49,10 @@ module.exports = {
|
||||||
return matrixClient;
|
return matrixClient;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
unset: function() {
|
||||||
|
matrixClient = null;
|
||||||
|
},
|
||||||
|
|
||||||
replaceUsingUrls: function(hs_url, is_url) {
|
replaceUsingUrls: function(hs_url, is_url) {
|
||||||
matrixClient = Matrix.createClient({
|
matrixClient = Matrix.createClient({
|
||||||
baseUrl: hs_url,
|
baseUrl: hs_url,
|
||||||
|
|
|
@ -90,7 +90,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
Notifier.stop();
|
Notifier.stop();
|
||||||
MatrixClientPeg.get().removeAllListeners();
|
MatrixClientPeg.get().removeAllListeners();
|
||||||
MatrixClientPeg.replace(null);
|
MatrixClientPeg.unset();
|
||||||
break;
|
break;
|
||||||
case 'start_registration':
|
case 'start_registration':
|
||||||
if (this.state.logged_in) return;
|
if (this.state.logged_in) return;
|
||||||
|
|
|
@ -76,11 +76,11 @@ module.exports = {
|
||||||
'password': formVals.password
|
'password': formVals.password
|
||||||
}).done(function(data) {
|
}).done(function(data) {
|
||||||
MatrixClientPeg.replaceUsingAccessToken(
|
MatrixClientPeg.replaceUsingAccessToken(
|
||||||
that.state.hs_url, that.state.is_url,
|
self.state.hs_url, self.state.is_url,
|
||||||
data.user_id, data.access_token
|
data.user_id, data.access_token
|
||||||
);
|
);
|
||||||
if (that.props.onLoggedIn) {
|
if (self.props.onLoggedIn) {
|
||||||
that.props.onLoggedIn();
|
self.props.onLoggedIn();
|
||||||
}
|
}
|
||||||
}, function(error) {
|
}, function(error) {
|
||||||
self.setStep("stage_m.login.password");
|
self.setStep("stage_m.login.password");
|
||||||
|
|
Loading…
Reference in New Issue