fix(files): Disable copy-move-action of single file shares

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2024-06-20 17:18:09 +02:00
parent f109c1a044
commit f0a765ee46
No known key found for this signature in database
GPG key ID: 45FAE7268762B400

View file

@ -265,7 +265,11 @@ export const action = new FileAction({
}
},
iconSvgInline: () => FolderMoveSvg,
enabled(nodes: Node[]) {
enabled(nodes: Node[], view: View) {
// We can not copy or move in single file shares
if (view.id === 'public-file-share') {
return false
}
// We only support moving/copying files within the user folder
if (!nodes.every(node => node.root?.startsWith('/files/'))) {
return false