fix(files): Show non writable folders during move or copy

Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
Louis Chemineau 2024-06-13 16:08:41 +02:00 committed by Arthur Schiwon
parent 3187425ca5
commit 6e9f04b59e
No known key found for this signature in database
GPG key ID: 7424F1874854DF23

View file

@ -200,17 +200,15 @@ const openFilePickerForAction = async (action: MoveCopyAction, dir = '/', nodes:
const filePicker = getFilePickerBuilder(t('files', 'Choose destination'))
.allowDirectories(true)
.setFilter((n: Node) => {
// We only want to show folders that we can create nodes in
return (n.permissions & Permission.CREATE) !== 0
// We don't want to show the current nodes in the file picker
&& !fileIDs.includes(n.fileid)
// We don't want to show the current nodes in the file picker
return !fileIDs.includes(n.fileid)
})
.setMimeTypeFilter([])
.setMultiSelect(false)
.startAt(dir)
return new Promise((resolve, reject) => {
filePicker.setButtonFactory((_selection, path: string) => {
filePicker.setButtonFactory((selection: Node[], path: string) => {
const buttons: IFilePickerButton[] = []
const target = basename(path)