Skip to content

Commit 4743c75

Browse files
committed
Merge #294 [V32] Filter files and e2ee from move or copy dialog
2 parents 3f2822b + e9d747e commit 4743c75

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/files/src/actions/moveOrCopyAction.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ async function openFilePickerForAction(
279279
// We don't want to show the current nodes in the file picker
280280
return !fileIDs.includes(n.fileid)
281281
})
282+
.setFilter((n: Node) => {
283+
// Show only non-encrypted directories in the file picker
284+
return !(n.attributes?.['type'] !== "directory" || n.attributes?.['is-encrypted'] === 1)
285+
})
282286
.setCanPick((n) => {
283287
const hasCreatePermissions = (n.permissions & Permission.CREATE) === Permission.CREATE
284288
return hasCreatePermissions
@@ -296,7 +300,7 @@ async function openFilePickerForAction(
296300
if (action === MoveCopyAction.COPY || action === MoveCopyAction.MOVE_OR_COPY) {
297301
buttons.push({
298302
label: target ? t('files', 'Copy to {target}', { target }, undefined, { escape: false, sanitize: false }) : t('files', 'Copy'),
299-
type: 'primary',
303+
variant: 'primary',
300304
icon: CopyIconSvg,
301305
async callback(destination: Node[]) {
302306
resolve({
@@ -326,7 +330,7 @@ async function openFilePickerForAction(
326330
if (action === MoveCopyAction.MOVE || action === MoveCopyAction.MOVE_OR_COPY) {
327331
buttons.push({
328332
label: target ? t('files', 'Move to {target}', { target }, undefined, { escape: false, sanitize: false }) : t('files', 'Move'),
329-
type: action === MoveCopyAction.MOVE ? 'primary' : 'secondary',
333+
variant: action === MoveCopyAction.MOVE ? 'primary' : 'secondary',
330334
icon: FolderMoveSvg,
331335
async callback(destination: Node[]) {
332336
resolve({

0 commit comments

Comments
 (0)