diff --git a/src/main/apis/gui/index.ts b/src/main/apis/gui/index.ts index 65e8117d..341c488f 100644 --- a/src/main/apis/gui/index.ts +++ b/src/main/apis/gui/index.ts @@ -69,7 +69,7 @@ class GuiApi implements IGuiApi { async showFileExplorer (options: IShowFileExplorerOption = {}) { this.windowId = await getWindowId() const res = await dialog.showOpenDialog(BrowserWindow.fromId(this.windowId)!, options) - return res.filePaths?.[0] + return res.filePaths || [] } async upload (input: IUploadOption) { diff --git a/src/universal/types/types.d.ts b/src/universal/types/types.d.ts index 905a83c5..be720885 100644 --- a/src/universal/types/types.d.ts +++ b/src/universal/types/types.d.ts @@ -193,7 +193,7 @@ type IDispose = () => void // GuiApi interface IGuiApi { showInputBox: (options: IShowInputBoxOption) => Promise - showFileExplorer: (options: IShowFileExplorerOption) => Promise + showFileExplorer: (options: IShowFileExplorerOption) => Promise upload: (input: IUploadOption) => Promise showNotification: (options?: IShowNotificationOption) => void showMessageBox: (options?: IShowMessageBoxOption) => Promise