diff options
author | Eduardo Morales <emoral435@gmail.com> | 2024-02-19 18:37:05 -0600 |
---|---|---|
committer | Eduardo Morales <emoral435@gmail.com> | 2024-02-23 20:08:58 -0600 |
commit | 7e7b086c4e35aba962562482369d5cc7ad759e1f (patch) | |
tree | 1811bad7f0ce5cfec12f1160737c8031582c10b9 /apps | |
parent | ba866cd4a8dbd022d9769fc28d7d86de1f0622e2 (diff) | |
download | nextcloud-server-7e7b086c4e35aba962562482369d5cc7ad759e1f.tar.gz nextcloud-server-7e7b086c4e35aba962562482369d5cc7ad759e1f.zip |
fix: merge conflict dialog added when overwriting files on move-file action
Signed-off-by: Eduardo Morales <emoral435@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/actions/moveOrCopyAction.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/files/src/actions/moveOrCopyAction.ts b/apps/files/src/actions/moveOrCopyAction.ts index 7fa899dc7da..e0789f5da60 100644 --- a/apps/files/src/actions/moveOrCopyAction.ts +++ b/apps/files/src/actions/moveOrCopyAction.ts @@ -32,12 +32,14 @@ import { emit } from '@nextcloud/event-bus' import { FilePickerClosed, getFilePickerBuilder, showError } from '@nextcloud/dialogs' import { Permission, FileAction, FileType, NodeStatus, davGetClient, davRootPath, davResultToNode, davGetDefaultPropfind } from '@nextcloud/files' import { translate as t } from '@nextcloud/l10n' +import { openConflictPicker, hasConflict } from '@nextcloud/upload' import Vue from 'vue' import CopyIconSvg from '@mdi/svg/svg/folder-multiple.svg?raw' import FolderMoveSvg from '@mdi/svg/svg/folder-move.svg?raw' import { MoveCopyAction, canCopy, canMove, getQueue } from './moveOrCopyActionUtils' +import { getContents } from '../services/Files' import logger from '../logger' import { getUniqueName } from '../utils/fileUtils' @@ -133,6 +135,13 @@ export const handleCopyMoveNodeTo = async (node: Node, destination: Folder, meth emit('files:node:created', davResultToNode(data)) } } else { + // show conflict file popup if we do not allow overwriting + if (!overwrite) { + const contents = await getContents(destinationPath) + if (hasConflict([node], contents.contents)) { + await openConflictPicker + } + } await client.moveFile(currentPath, join(destinationPath, node.basename)) // Delete the node as it will be fetched again // when navigating to the destination folder |