File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments