Skip to content

Commit 2d5448d

Browse files
committed
Merge #277 [fix30] setFilter in moveOrCopyAction
2 parents 3c0bff1 + 6bcf157 commit 2d5448d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apps/files/src/actions/moveOrCopyAction.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,19 @@ async function openFilePickerForAction(
222222
// We don't want to show the current nodes in the file picker
223223
return !fileIDs.includes(n.fileid)
224224
})
225+
.setFilter((n: Node) => {
226+
// We only want to show folders in the file picker
227+
// We don't want to show encrypted folders in the file picker
228+
return !(n.attributes?.['type'] !== "directory" || n.attributes?.['is-encrypted'] === 1)
225229
.setCanPick((n) => {
226230
const hasCreatePermissions = (n.permissions & Permission.CREATE) === Permission.CREATE
227231
return hasCreatePermissions
228232
})
233+
.setFilter((n: Node) => {
234+
// We only want to show folders in the file picker
235+
// We don't want to show encrypted folders in the file picker
236+
return !(n.attributes?.['type'] !== "directory" || n.attributes?.['is-encrypted'] === 1)
237+
})
229238
.setMimeTypeFilter([])
230239
.setMultiSelect(false)
231240
.startAt(dir)

0 commit comments

Comments
 (0)