Update shared folder owners locally when offering ownership

pull/1/head
yflory 5 years ago
parent a77d2da47c
commit 77c6269e0c

@ -82,9 +82,11 @@ define([
// All occurences are returned, in drive or shared folders // All occurences are returned, in drive or shared folders
var findChannel = function (Env, channel) { var findChannel = function (Env, channel) {
var ret = []; var ret = [];
Env.user.userObject.findChannels([channel]).forEach(function (id) { Env.user.userObject.findChannels([channel], true).forEach(function (id) {
var data = Env.user.proxy[UserObject.SHARED_FOLDERS][id] ||
Env.user.userObject.getFileData(id);
ret.push({ ret.push({
data: Env.user.userObject.getFileData(id), data: data,
userObject: Env.user.userObject userObject: Env.user.userObject
}); });
}); });

@ -492,10 +492,13 @@ define([
}; };
// Get drive ids of files from their channel ids // Get drive ids of files from their channel ids
exp.findChannels = function (channels) { exp.findChannels = function (channels, includeSharedFolders) {
var allFilesList = files[FILES_DATA]; var allFilesList = files[FILES_DATA];
return getFiles([FILES_DATA]).filter(function (k) { var sfList = files[SHARED_FOLDERS];
var data = allFilesList[k]; var paths = [FILES_DATA];
if (includeSharedFolders) { paths.push(SHARED_FOLDERS); }
return getFiles(paths).filter(function (k) {
var data = allFilesList[k] || sfList[k] || {};
return channels.indexOf(data.channel) !== -1; return channels.indexOf(data.channel) !== -1;
}); });
}; };

Loading…
Cancel
Save