mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Implement review feedback
This commit is contained in:
parent
b3cfa60239
commit
420c4969c7
@ -530,7 +530,13 @@ const factory = (UserObject, Util, Hash,
|
||||
var toCopy = _getCopyFromPaths(Env, resolved.main, Env.user.userObject);
|
||||
var newUserObject = newResolved.userObject;
|
||||
toCopy.forEach(function (obj) {
|
||||
newUserObject.copyFromOtherDrive(newResolved.path, obj.el, obj.data, obj.key);
|
||||
try {
|
||||
newUserObject.copyFromOtherDrive(newResolved.path, obj.el, obj.data, obj.key);
|
||||
} catch (err) {
|
||||
if (!moveError) {
|
||||
moveError = err;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (copy) { return; }
|
||||
@ -562,7 +568,13 @@ const factory = (UserObject, Util, Hash,
|
||||
// Copy the elements to the new location
|
||||
var toCopy = _getCopyFromPaths(Env, paths, uoFrom);
|
||||
toCopy.forEach(function (obj) {
|
||||
uoTo.copyFromOtherDrive(newResolved.path, obj.el, obj.data, obj.key);
|
||||
try {
|
||||
uoTo.copyFromOtherDrive(newResolved.path, obj.el, obj.data, obj.key);
|
||||
} catch (err) {
|
||||
if (!moveError) {
|
||||
moveError = err;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (copy) { return; }
|
||||
@ -1505,15 +1517,10 @@ const factory = (UserObject, Util, Hash,
|
||||
newName: newName
|
||||
}
|
||||
}, function (err, responseData) {
|
||||
if (err) {
|
||||
return void cb(err);
|
||||
if (err || responseData?.error) {
|
||||
return void cb(err || responseData);
|
||||
}
|
||||
// responseData is what rename passed to cb(error)
|
||||
if (responseData && typeof responseData === 'object' && responseData.error) {
|
||||
return void cb(responseData);
|
||||
}
|
||||
// No error
|
||||
cb(null);
|
||||
cb();
|
||||
});
|
||||
};
|
||||
var moveInner = function (Env, paths, newPath, cb, copy) {
|
||||
@ -1525,14 +1532,10 @@ const factory = (UserObject, Util, Hash,
|
||||
copy: copy
|
||||
}
|
||||
}, function (err, responseData) {
|
||||
if (err) {
|
||||
return void cb(err);
|
||||
if (err || responseData?.error) {
|
||||
return void cb(err || responseData);
|
||||
}
|
||||
if (responseData && typeof responseData === 'object' && responseData.error) {
|
||||
return void cb(responseData);
|
||||
}
|
||||
// No error
|
||||
cb(null);
|
||||
cb();
|
||||
});
|
||||
};
|
||||
var emptyTrashInner = function (Env, deleteOwned, cb) {
|
||||
|
||||
@ -845,10 +845,12 @@ const factory = (Util, Hash,
|
||||
}
|
||||
}
|
||||
});
|
||||
if (duplicateError) {
|
||||
return void cb(duplicateError);
|
||||
}
|
||||
exp.delete(toRemove, cb);
|
||||
exp.delete(toRemove, function (err) {
|
||||
if (err || duplicateError) {
|
||||
return void cb(err || duplicateError);
|
||||
}
|
||||
cb();
|
||||
});
|
||||
};
|
||||
exp.restore = function (path, cb) {
|
||||
if (sframeChan) {
|
||||
|
||||
@ -1880,6 +1880,10 @@ define([
|
||||
var newCb = function (err) {
|
||||
if (err && err.error === 'E_DUPLICATE_FOLDER_NAME') {
|
||||
UI.alert(err.message || Messages.fo_unavailableName);
|
||||
paths.forEach(function (path) {
|
||||
LS.moveFoldersOpened(path, newPath);
|
||||
});
|
||||
cb();
|
||||
return;
|
||||
}
|
||||
paths.forEach(function (path) {
|
||||
|
||||
2
www/common/worker.bundle.min.js
vendored
2
www/common/worker.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user