Guard onLoggedIn since registration uses it too and that isn't done yet

This commit is contained in:
Kegan Dougal 2015-11-12 16:14:01 +00:00
parent b8d579ac5c
commit 900b7dd94a

View File

@ -294,11 +294,13 @@ module.exports = {
},
onLoggedIn: function(credentials) {
console.log("onLoggedIn => %s", credentials.userId);
MatrixClientPeg.replaceUsingAccessToken(
credentials.homeserverUrl, credentials.identityServerUrl,
credentials.userId, credentials.accessToken
);
if (credentials) { // registration doesn't do this yet
console.log("onLoggedIn => %s", credentials.userId);
MatrixClientPeg.replaceUsingAccessToken(
credentials.homeserverUrl, credentials.identityServerUrl,
credentials.userId, credentials.accessToken
);
}
this.setState({
screen: undefined,
logged_in: true