From fd7567188be2bd2ed2fceccec565ae6791d37f04 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 4 Sep 2019 17:54:32 +0200 Subject: [PATCH] Clean some code --- www/common/outer/async-store.js | 10 ++++++---- www/common/proxy-manager.js | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 2b6144026..900839d6f 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -1524,10 +1524,12 @@ define([ }); }; Store.addSharedFolder = function (clientId, data, cb) { - Store.userObjectCommand(clientId, { - cmd: 'addSharedFolder', - data: data - }, cb); + store.manager.addSharedFolder(data, function (id) { + sendDriveEvent('DRIVE_CHANGE', { + path: ['drive', UserObject.FILES_DATA] + }, clientId); + cb(id); + }); }; // Drive diff --git a/www/common/proxy-manager.js b/www/common/proxy-manager.js index e00d85105..474fb09a1 100644 --- a/www/common/proxy-manager.js +++ b/www/common/proxy-manager.js @@ -458,7 +458,9 @@ define([ } })); }).nThen(function () { - cb(id); + Env.onSync(function () { + cb(id); + }); }); }; @@ -935,6 +937,7 @@ define([ // Manager addProxy: callWithEnv(addProxy), removeProxy: callWithEnv(removeProxy), + addSharedFolder: callWithEnv(addSharedFolder); // Drive command: callWithEnv(onCommand), getPadAttribute: callWithEnv(getPadAttribute),