aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/actions
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-03-22 18:30:52 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2024-04-18 12:53:28 +0200
commitf8d451f95f42ef410c4144cd60c1f97c3a70ad69 (patch)
treeb0c655324b050d69328b157fff2e0a583de442b9 /apps/files/src/actions
parent2a9a5b3513c8e11f1fcbc141dabb215018d323dd (diff)
downloadnextcloud-server-f8d451f95f42ef410c4144cd60c1f97c3a70ad69.tar.gz
nextcloud-server-f8d451f95f42ef410c4144cd60c1f97c3a70ad69.zip
fix(files): When copying nodes only add the copy suffix for file before file extension
Co-authored-by: Pytal <24800714+Pytal@users.noreply.github.com> Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files/src/actions')
-rw-r--r--apps/files/src/actions/moveOrCopyAction.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/files/src/actions/moveOrCopyAction.ts b/apps/files/src/actions/moveOrCopyAction.ts
index eb54c4c3f82..2456340a02c 100644
--- a/apps/files/src/actions/moveOrCopyAction.ts
+++ b/apps/files/src/actions/moveOrCopyAction.ts
@@ -120,7 +120,14 @@ export const handleCopyMoveNodeTo = async (node: Node, destination: Folder, meth
// If we do not allow overwriting then find an unique name
if (!overwrite) {
const otherNodes = await client.getDirectoryContents(destinationPath) as FileStat[]
- target = getUniqueName(node.basename, otherNodes.map((n) => n.basename), copySuffix)
+ target = getUniqueName(
+ node.basename,
+ otherNodes.map((n) => n.basename),
+ {
+ suffix: copySuffix,
+ ignoreFileExtension: node.type === FileType.Folder,
+ },
+ )
}
await client.copyFile(currentPath, join(destinationPath, target))
// If the node is copied into current directory the view needs to be updated
@@ -150,7 +157,7 @@ export const handleCopyMoveNodeTo = async (node: Node, destination: Folder, meth
}
} catch (error) {
// User cancelled
- showError(t('files','Move cancelled'))
+ showError(t('files', 'Move cancelled'))
return
}
}