We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 05f7e03 + 85f02c5 commit 4092453Copy full SHA for 4092453
1 file changed
lib/filepicker-builder.ts
@@ -100,9 +100,10 @@ export class FilePicker<IsMultiSelect extends boolean> {
100
public async pick(): Promise<IsMultiSelect extends true ? string[] : string> {
101
const nodes = await this.pickNodes()
102
if (this.multiSelect) {
103
- return (nodes[0]?.path ?? '/') as (IsMultiSelect extends true ? string[] : string)
+ return nodes.map((node) => node.path) as (IsMultiSelect extends true ? string[] : string)
104
}
105
- return nodes.map((node) => node.path) as (IsMultiSelect extends true ? string[] : string)
+ const path = nodes[0]?.path ?? '/'
106
+ return path as (IsMultiSelect extends true ? string[] : string)
107
108
109
0 commit comments