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