mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-12 19:49:59 +05:00
Fix automatically renaming of same name folders in copyFromOtherDrive function
This commit is contained in:
parent
53eab89c8a
commit
b6401aa0c2
@ -541,7 +541,7 @@ const factory = (UserObject, Util, Hash,
|
||||
|
||||
if (copy) { return; }
|
||||
|
||||
if (resolved.main.length) {
|
||||
if (resolved.main.length && !moveError) {
|
||||
// Remove the elements from the old location (without unpinning)
|
||||
Env.user.userObject.delete(resolved.main, waitFor()); // FIXME waitFor() is called synchronously
|
||||
}
|
||||
@ -580,7 +580,9 @@ const factory = (UserObject, Util, Hash,
|
||||
if (copy) { return; }
|
||||
|
||||
// Remove the elements from the old location (without unpinning)
|
||||
uoFrom.delete(paths, waitFor()); // FIXME waitFor() is called synchronously
|
||||
if (!moveError) {
|
||||
uoFrom.delete(paths, waitFor()); // FIXME waitFor() is called synchronously
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -314,6 +314,14 @@ const factory = (Util, Hash, Realtime) => {
|
||||
// Copy file or folder
|
||||
var newParent = exp.find(path);
|
||||
var tempName = exp.isFile(element) ? Hash.createChannelId() : key;
|
||||
if (exp.isFolder(element) && tempName !== Messages.fm_newFolder &&
|
||||
typeof(newParent[tempName]) !== "undefined") {
|
||||
throw {
|
||||
error: 'E_DUPLICATE_FOLDER_NAME',
|
||||
folderName: tempName,
|
||||
message: Messages.fo_unavailableName
|
||||
};
|
||||
}
|
||||
var newName = exp.getAvailableName(newParent, tempName);
|
||||
if (Array.isArray(newParent)) {
|
||||
newParent.push(element);
|
||||
|
||||
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