Fix shared folders not removed from memory in inner

pull/1/head
yflory 5 years ago
parent bfd46fb570
commit 80f5ebc0cc

@ -58,6 +58,14 @@ define([
APP.newSharedFolder = null; 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] || {}; folders[fId] = folders[fId] || {};
copyObjectValue(folders[fId], newObj); copyObjectValue(folders[fId], newObj);
folders[fId].readOnly = !secret.keys.secondaryKey; folders[fId].readOnly = !secret.keys.secondaryKey;
@ -69,6 +77,15 @@ define([
manager.folders[fId].userObject.setReadOnly(readOnly, secret.keys.secondaryKey); 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 () { }).nThen(function () {
cb(); cb();
}); });

@ -80,6 +80,16 @@ define([
manager.folders[fId].userObject.setReadOnly(readOnly, secret.keys.secondaryKey); 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 () { }).nThen(function () {
cb(); cb();
}); });

Loading…
Cancel
Save