Fix user being "logged out" after upgrading (#1798)

This commit is contained in:
Elias Nahum 2018-06-21 18:17:59 -04:00 committed by GitHub
parent e19b6a08d3
commit 3055a43ec8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,6 +76,7 @@ export default class App {
return Initialization.credentials;
},
() => {
this.waitForRehydration = true;
return getGenericPassword();
}
);
@ -153,6 +154,13 @@ export default class App {
}
const username = `${deviceToken}, ${currentUserId}`;
const password = `${token},${url}`;
if (this.waitForRehydration) {
this.waitForRehydration = false;
this.token = token;
this.url = url;
}
setGenericPassword(username, password);
};
@ -215,7 +223,7 @@ export default class App {
};
startApp = () => {
if (this.appStarted) {
if (this.appStarted || this.waitForRehydration) {
return;
}