diff options
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) }, |