Skip to content

Commit 4092453

Browse files
authored
Merge pull request #1777 from nextcloud-libraries/backport/1775/stable6
2 parents 05f7e03 + 85f02c5 commit 4092453

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/filepicker-builder.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ export class FilePicker<IsMultiSelect extends boolean> {
100100
public async pick(): Promise<IsMultiSelect extends true ? string[] : string> {
101101
const nodes = await this.pickNodes()
102102
if (this.multiSelect) {
103-
return (nodes[0]?.path ?? '/') as (IsMultiSelect extends true ? string[] : string)
103+
return nodes.map((node) => node.path) as (IsMultiSelect extends true ? string[] : string)
104104
}
105-
return nodes.map((node) => node.path) as (IsMultiSelect extends true ? string[] : string)
105+
const path = nodes[0]?.path ?? '/'
106+
return path as (IsMultiSelect extends true ? string[] : string)
106107
}
107108

108109
}

0 commit comments

Comments
 (0)