mirror of
https://github.com/nextcloud/server.git
synced 2026-03-23 19:03:20 -04:00
Merge pull request #48331 from nextcloud/fix/duplicated-conflict-resolution
fix(files): Fix having to resolve conflicts twice when dropping files
This commit is contained in:
commit
6befdd6dd7
6 changed files with 20 additions and 19 deletions
|
|
@ -123,19 +123,21 @@ export const handleCopyMoveNodeTo = async (node: Node, destination: Folder, meth
|
|||
}
|
||||
} else {
|
||||
// show conflict file popup if we do not allow overwriting
|
||||
const otherNodes = await getContents(destination.path)
|
||||
if (hasConflict([node], otherNodes.contents)) {
|
||||
try {
|
||||
// Let the user choose what to do with the conflicting files
|
||||
const { selected, renamed } = await openConflictPicker(destination.path, [node], otherNodes.contents)
|
||||
// two empty arrays: either only old files or conflict skipped -> no action required
|
||||
if (!selected.length && !renamed.length) {
|
||||
if (!overwrite) {
|
||||
const otherNodes = await getContents(destination.path)
|
||||
if (hasConflict([node], otherNodes.contents)) {
|
||||
try {
|
||||
// Let the user choose what to do with the conflicting files
|
||||
const { selected, renamed } = await openConflictPicker(destination.path, [node], otherNodes.contents)
|
||||
// two empty arrays: either only old files or conflict skipped -> no action required
|
||||
if (!selected.length && !renamed.length) {
|
||||
return
|
||||
}
|
||||
} catch (error) {
|
||||
// User cancelled
|
||||
showError(t('files', 'Move cancelled'))
|
||||
return
|
||||
}
|
||||
} catch (error) {
|
||||
// User cancelled
|
||||
showError(t('files', 'Move cancelled'))
|
||||
return
|
||||
}
|
||||
}
|
||||
// getting here means either no conflict, file was renamed to keep both files
|
||||
|
|
|
|||
|
|
@ -178,8 +178,7 @@ export const onDropInternalFiles = async (nodes: Node[], destination: Folder, co
|
|||
|
||||
for (const node of nodes) {
|
||||
Vue.set(node, 'status', NodeStatus.LOADING)
|
||||
// TODO: resolve potential conflicts prior and force overwrite
|
||||
queue.push(handleCopyMoveNodeTo(node, destination, isCopy ? MoveCopyAction.COPY : MoveCopyAction.MOVE))
|
||||
queue.push(handleCopyMoveNodeTo(node, destination, isCopy ? MoveCopyAction.COPY : MoveCopyAction.MOVE, true))
|
||||
}
|
||||
|
||||
// Wait for all promises to settle
|
||||
|
|
|
|||
4
dist/files-init.js
vendored
4
dist/files-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-init.js.map
vendored
2
dist/files-init.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/files-main.js
vendored
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue