diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2025-02-28 18:13:24 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2025-02-28 18:13:24 +0100 |
commit | 8b36b915febf76ade3e00c2d0563a370e8ba9f62 (patch) | |
tree | e8a3f47c82da67364b6dfdd55844e8d159beee2b /apps/files/src | |
parent | 8213252201b48b1ee77c980e1c9671875fda1600 (diff) | |
download | nextcloud-server-8b36b915febf76ade3e00c2d0563a370e8ba9f62.tar.gz nextcloud-server-8b36b915febf76ade3e00c2d0563a370e8ba9f62.zip |
fix(files_trashbin): disable bulk download for trashbin
The backend does not allow bulk download within the trashbin,
so we need to disable this also on the frontend.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files/src')
-rw-r--r-- | apps/files/src/actions/downloadAction.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/files/src/actions/downloadAction.ts b/apps/files/src/actions/downloadAction.ts index 19e0b3502fa..b4c04d2970c 100644 --- a/apps/files/src/actions/downloadAction.ts +++ b/apps/files/src/actions/downloadAction.ts @@ -2,7 +2,8 @@ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { FileAction, Node, FileType, DefaultType } from '@nextcloud/files' +import type { Node, View } from '@nextcloud/files' +import { FileAction, FileType, DefaultType } from '@nextcloud/files' import { t } from '@nextcloud/l10n' import { isDownloadable } from '../utils/permissions' @@ -75,7 +76,7 @@ export const action = new FileAction({ displayName: () => t('files', 'Download'), iconSvgInline: () => ArrowDownSvg, - enabled(nodes: Node[]) { + enabled(nodes: Node[], view: View) { if (nodes.length === 0) { return false } @@ -85,6 +86,11 @@ export const action = new FileAction({ return false } + // Trashbin does not allow batch download + if (nodes.length > 1 && view.id === 'trashbin') { + return false + } + return nodes.every(isDownloadable) }, |