From 62c96d562fc382e9451b02f3d513f69d69cf1e0e Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 6 Jun 2019 15:33:08 +0200 Subject: [PATCH] Fix race condition with nthen --- www/common/migrate-user-object.js | 2 +- www/common/outer/async-store.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/www/common/migrate-user-object.js b/www/common/migrate-user-object.js index 54c1c6111..4c6e38d85 100644 --- a/www/common/migrate-user-object.js +++ b/www/common/migrate-user-object.js @@ -197,7 +197,7 @@ define([ }, 500); progress(0, 0);*/ }).nThen(function () { - cb(); + setTimeout(cb); }); }; }); diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index ad9982030..6198b0b96 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1644,6 +1644,7 @@ define([ }); userObject.migrate(waitFor()); }).nThen(function (waitFor) { + loadMailbox(waitFor); Migrate(proxy, waitFor(), function (version, progress) { postMessage(clientId, 'LOADING_DRIVE', { state: (2 + (version / 10)), @@ -1661,7 +1662,6 @@ define([ loadMessenger(); loadCursor(); loadOnlyOffice(); - loadMailbox(waitFor); loadUniversal(Profile, 'profile', waitFor); cleanFriendRequests(); }).nThen(function () {