diff options
author | Kate <26026535+provokateurin@users.noreply.github.com> | 2025-03-03 16:50:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-03 16:50:34 +0100 |
commit | 2582a55300ac83a806d79499c9bbe7db4e310aee (patch) | |
tree | c2e8de39f30400334ceb169f74e91b37cac42528 /apps | |
parent | 3bc3d030482fc5116ad83da6223a723d729fc1b0 (diff) | |
parent | 61444e5e083d30709b672971dd434af2186b00c8 (diff) | |
download | nextcloud-server-2582a55300ac83a806d79499c9bbe7db4e310aee.tar.gz nextcloud-server-2582a55300ac83a806d79499c9bbe7db4e310aee.zip |
Merge pull request #51146 from nextcloud/fix/files-trash-download
fix(files_trashbin): disable bulk download for trashbin
Diffstat (limited to 'apps')
-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) }, |