Fix an issue with new shared folder added to drive from another session

pull/1/head
yflory 6 years ago
parent 62817d09cb
commit 0e1c525c30

@ -65,6 +65,13 @@ define([
Store.getSharedFolder = function (clientId, id, cb) {
if (store.manager.folders[id]) {
return void cb(store.manager.folders[id].proxy);
} else {
var shared = Util.find(store.proxy, ['drive', UserObject.SHARED_FOLDERS]) || {};
if (shared[id]) {
return void Store.loadSharedFolder(id, shared[id], function () {
cb(store.manager.folders[id].proxy);
});
}
}
cb({});
};
@ -1165,7 +1172,7 @@ define([
};
// SHARED FOLDERS
var loadSharedFolder = function (id, data, cb) {
var loadSharedFolder = Store.loadSharedFolder = function (id, data, cb) {
var parsed = Hash.parsePadUrl(data.href);
var secret = Hash.getSecrets('drive', parsed.hash, data.password);
var owners = data.owners;

@ -370,7 +370,7 @@ define([
cb(obj);
});
};
// Add a folder/subfolder
// Add a shared folder
var _addSharedFolder = function (Env, data, cb) {
data = data || {};
var resolved = _resolvePath(Env, data.path);

Loading…
Cancel
Save