Fix shared folders not removed from memory in inner
parent
bfd46fb570
commit
80f5ebc0cc
|
@ -58,6 +58,14 @@ define([
|
|||
APP.newSharedFolder = null;
|
||||
}
|
||||
}
|
||||
if (newObj && newObj.deprecated) {
|
||||
delete folders[fId];
|
||||
delete drive.sharedFolders[fId];
|
||||
if (manager && manager.folders) {
|
||||
delete manager.folders[fId];
|
||||
}
|
||||
return;
|
||||
}
|
||||
folders[fId] = folders[fId] || {};
|
||||
copyObjectValue(folders[fId], newObj);
|
||||
folders[fId].readOnly = !secret.keys.secondaryKey;
|
||||
|
@ -69,6 +77,15 @@ define([
|
|||
manager.folders[fId].userObject.setReadOnly(readOnly, secret.keys.secondaryKey);
|
||||
}));
|
||||
});
|
||||
oldIds.forEach(function (fId) {
|
||||
if (!drive.sharedFolders[fId]) {
|
||||
delete folders[fId];
|
||||
delete drive.sharedFolders[fId];
|
||||
if (manager && manager.folders) {
|
||||
delete manager.folders[fId];
|
||||
}
|
||||
}
|
||||
});
|
||||
}).nThen(function () {
|
||||
cb();
|
||||
});
|
||||
|
|
|
@ -80,6 +80,16 @@ define([
|
|||
manager.folders[fId].userObject.setReadOnly(readOnly, secret.keys.secondaryKey);
|
||||
}));
|
||||
});
|
||||
// Remove from memory folders that have been deleted from the drive remotely
|
||||
oldIds.forEach(function (fId) {
|
||||
if (!drive.sharedFolders[fId]) {
|
||||
delete folders[fId];
|
||||
delete drive.sharedFolders[fId];
|
||||
if (manager && manager.folders) {
|
||||
delete manager.folders[fId];
|
||||
}
|
||||
}
|
||||
});
|
||||
}).nThen(function () {
|
||||
cb();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue