Skip to content

Commit bd6ee2d

Browse files
susnuxAndyScherzinger
authored andcommitted
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 <opensource@fthiessen.de>
1 parent 8055ee1 commit bd6ee2d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

apps/files/src/actions/moveOrCopyAction.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ async function openFilePickerForAction(
299299
if (action === MoveCopyAction.COPY || action === MoveCopyAction.MOVE_OR_COPY) {
300300
buttons.push({
301301
label: target ? t('files', 'Copy to {target}', { target }, { escape: false, sanitize: false }) : t('files', 'Copy'),
302+
disabled: selection.length === 0,
302303
variant: 'primary',
303304
icon: CopyIconSvg,
304305
async callback(destination) {
@@ -329,6 +330,7 @@ async function openFilePickerForAction(
329330
if (action === MoveCopyAction.MOVE || action === MoveCopyAction.MOVE_OR_COPY) {
330331
buttons.push({
331332
label: target ? t('files', 'Move to {target}', { target }, { escape: false, sanitize: false }) : t('files', 'Move'),
333+
disabled: selection.length === 0,
332334
variant: action === MoveCopyAction.MOVE ? 'primary' : 'secondary',
333335
icon: FolderMoveSvg,
334336
async callback(destination) {

0 commit comments

Comments
 (0)