From f7477b65ea7afda58ad7bf9a7f66d940fd1b3364 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 11 Feb 2021 12:31:13 +0100 Subject: [PATCH] Offline shared folders --- www/common/outer/async-store.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 900172f16..11a17646a 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -2565,8 +2565,21 @@ define([ rt: store.realtime }); var userObject = store.userObject = manager.user.userObject; - addSharedFolderHandler(); - userObject.migrate(cb); + nThen(function (waitFor) { + addSharedFolderHandler(); + userObject.migrate(waitFor()); + }).nThen(function (waitFor) { + var network = store.network || store.networkPromise; + SF.loadSharedFolders(Store, network, store, userObject, waitFor, function (obj) { + var data = { + type: 'sf', + progress: 100*obj.progress/obj.max + }; + postMessage(clientId, 'LOADING_DRIVE', data); + }); + }).nThen(function () { + cb(); + }); }; // onReady: called when the drive is synced (not using the cache anymore)