Fix undefined hash for deleted shared folders

pull/1/head
yflory 6 years ago
parent d760961719
commit bbc06f668f

@ -681,8 +681,20 @@ define([
var sf = files[SHARED_FOLDERS]; var sf = files[SHARED_FOLDERS];
var rootFiles = exp.getFiles([ROOT]); var rootFiles = exp.getFiles([ROOT]);
var root = exp.find([ROOT]); var root = exp.find([ROOT]);
var parsed, secret, el;
for (var id in sf) { for (var id in sf) {
el = sf[id];
id = Number(id); id = Number(id);
// Fix undefined hash
parsed = Hash.parsePadUrl(el.href || el.roHref);
secret = Hash.getSecrets('drive', parsed.hash, el.password);
if (!secret.keys) {
delete sf[id];
continue;
}
// Fix shared folder not displayed in root
if (rootFiles.indexOf(id) === -1) { if (rootFiles.indexOf(id) === -1) {
console.log('missing' + id); console.log('missing' + id);
var newName = Hash.createChannelId(); var newName = Hash.createChannelId();

Loading…
Cancel
Save