From 66f55cbbede06f0fe9a20072b9b8219da47ce2ee Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 17 Jul 2026 00:07:13 +0200 Subject: [PATCH] fix(files): properly handle folders without permissions There was a bug in the filepicker (dialogs library) that passed always the current folder as selected node even if not pickable (`setCanPick`). So updated the library. But we also must check if we have any nodes selected to enable the copy and move buttons. Signed-off-by: Ferdinand Thiessen --- apps/files/src/actions/moveOrCopyAction.ts | 2 ++ build/frontend-legacy/package.json | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/files/src/actions/moveOrCopyAction.ts b/apps/files/src/actions/moveOrCopyAction.ts index 2920a1cb5f7..e8edec16f52 100644 --- a/apps/files/src/actions/moveOrCopyAction.ts +++ b/apps/files/src/actions/moveOrCopyAction.ts @@ -299,6 +299,7 @@ async function openFilePickerForAction( if (action === MoveCopyAction.COPY || action === MoveCopyAction.MOVE_OR_COPY) { buttons.push({ label: target ? t('files', 'Copy to {target}', { target }, { escape: false, sanitize: false }) : t('files', 'Copy'), + disabled: selection.length === 0, variant: 'primary', icon: CopyIconSvg, async callback(destination) { @@ -329,6 +330,7 @@ async function openFilePickerForAction( if (action === MoveCopyAction.MOVE || action === MoveCopyAction.MOVE_OR_COPY) { buttons.push({ label: target ? t('files', 'Move to {target}', { target }, { escape: false, sanitize: false }) : t('files', 'Move'), + disabled: selection.length === 0, variant: action === MoveCopyAction.MOVE ? 'primary' : 'secondary', icon: FolderMoveSvg, async callback(destination) { diff --git a/build/frontend-legacy/package.json b/build/frontend-legacy/package.json index 7e00d759bd4..71a664bc6a6 100644 --- a/build/frontend-legacy/package.json +++ b/build/frontend-legacy/package.json @@ -36,7 +36,7 @@ "@nextcloud/axios": "^2.5.2", "@nextcloud/browser-storage": "^0.5.0", "@nextcloud/capabilities": "^1.2.1", - "@nextcloud/dialogs": "^7.4.0", + "@nextcloud/dialogs": "^7.4.1", "@nextcloud/event-bus": "^3.3.3", "@nextcloud/files": "^4.0.0", "@nextcloud/initial-state": "^3.0.0", diff --git a/package.json b/package.json index d9483b97637..1e4827a7b7e 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@nextcloud/axios": "^2.5.2", "@nextcloud/calendar-availability-vue": "^3.0.0", "@nextcloud/capabilities": "^1.2.1", - "@nextcloud/dialogs": "^7.4.0", + "@nextcloud/dialogs": "^7.4.1", "@nextcloud/event-bus": "^3.3.3", "@nextcloud/files": "^4.0.0", "@nextcloud/initial-state": "^3.0.0",