diff --git a/lib/filepicker-builder.ts b/lib/filepicker-builder.ts index c0f9f31f4..0f377dd67 100644 --- a/lib/filepicker-builder.ts +++ b/lib/filepicker-builder.ts @@ -100,9 +100,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) } }