Wait for hydration before app launch (#4525)

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
Mattermost Build 2020-07-02 22:56:42 +02:00 committed by GitHub
parent ef4bc3b1e2
commit fa86680036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,8 +56,8 @@ const launchApp = (credentials) => {
]);
const store = Store.redux;
if (credentials) {
waitForHydration(store, async () => {
waitForHydration(store, async () => {
if (credentials) {
const {previousVersion} = store.getState().app;
const valid = validatePreviousVersion(previousVersion);
if (valid) {
@ -69,10 +69,10 @@ const launchApp = (credentials) => {
captureJSException(error, false, store);
store.dispatch(logout());
}
});
} else {
resetToSelectServer(emmProvider.allowOtherServers);
}
} else {
resetToSelectServer(emmProvider.allowOtherServers);
}
});
telemetry.startSinceLaunch(['start:splash_screen']);
EphemeralStore.appStarted = true;