Restore full hash when safe hash is deleted from the drive

This commit is contained in:
yflory
2020-01-29 18:38:13 +01:00
parent 9961bffd48
commit 464eaee49a
5 changed files with 55 additions and 3 deletions

View File

@@ -771,6 +771,9 @@ define([
toUnpin.forEach(function (chan) {
if (toKeep.indexOf(chan) === -1) {
unpinList.push(chan);
// Check if need need to restore a full hash (hidden hash deleted from drive)
Env.Store.checkDeletedPad(chan);
}
});
@@ -783,7 +786,16 @@ define([
};
// Empty the trash (main drive only)
var _emptyTrash = function (Env, data, cb) {
Env.user.userObject.emptyTrash(cb);
Env.user.userObject.emptyTrash(function (err, toClean) {
cb();
// Check if need need to restore a full hash (hidden hash deleted from drive)
if (!Array.isArray(toClean)) { return; }
var toCheck = Util.deduplicateString(toClean);
toCheck.forEach(function (chan) {
Env.Store.checkDeletedPad(chan);
});
});
};
// Rename files or folders
var _rename = function (Env, data, cb) {