Skip to content

Commit

Permalink
plugin: fix 'canSelectMany' implementation
Browse files Browse the repository at this point in the history
The following commit fixes the `dialog-main` implementation for
`canSelectMany` which would incorrectly map the uris when an array is
returned by the service.

Signed-off-by: vince-fugnitto <[email protected]>
  • Loading branch information
vince-fugnitto committed Mar 30, 2021
1 parent 1c0f358 commit d3cc96f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/plugin-ext/src/main/browser/dialogs-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ export class DialogsMainImpl implements DialogsMain {
} as OpenFileDialogProps;

const result = await this.fileDialogService.showOpenDialog(dialogProps, rootStat);
return result ? [result].map(uri => uri.path.toString()) : undefined;
if (Array.isArray(result)) {
return result.map(uri => uri.path.toString());
} else {
return result ? [result].map(uri => uri.path.toString()) : undefined;
}
} catch (error) {
console.error(error);
}
Expand Down

0 comments on commit d3cc96f

Please sign in to comment.