diff --git a/lib/filepicker-builder.ts b/lib/filepicker-builder.ts index 40679e999..404c8a2de 100644 --- a/lib/filepicker-builder.ts +++ b/lib/filepicker-builder.ts @@ -98,9 +98,10 @@ export class FilePicker { public async pick(): Promise { const nodes = await this.pickNodes() if (this.multiSelect) { - return (nodes[0]?.path ?? '/') as (IsMultiSelect extends true ? string[] : string) + return nodes.map((node) => node.path) as (IsMultiSelect extends true ? string[] : string) } - return nodes.map((node) => node.path) as (IsMultiSelect extends true ? string[] : string) + const path = nodes[0]?.path ?? '/' + return path as (IsMultiSelect extends true ? string[] : string) } }