Skip to content

Commit fe01ed7

Browse files
trop[bot]Kilian
andauthored
docs: correct the return value for canceled showSaveDialog (#41946)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Kilian Valkhof <[email protected]>
1 parent 7f26c72 commit fe01ed7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/api/dialog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ dialog.showOpenDialog(mainWindow, {
174174
* `dontAddToRecent` _Windows_ - Do not add the item being saved to the recent documents list.
175175
* `securityScopedBookmarks` boolean (optional) _macOS_ _mas_ - Create a [security scoped bookmark](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store. If this option is enabled and the file doesn't already exist a blank file will be created at the chosen path.
176176

177-
Returns `string | undefined`, the path of the file chosen by the user; if the dialog is cancelled it returns `undefined`.
177+
Returns `string`, the path of the file chosen by the user; if the dialog is cancelled it returns an empty string.
178178

179179
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
180180

@@ -207,7 +207,7 @@ The `filters` specifies an array of file types that can be displayed, see
207207
Returns `Promise<Object>` - Resolve with an object containing the following:
208208

209209
* `canceled` boolean - whether or not the dialog was canceled.
210-
* `filePath` string (optional) - If the dialog is canceled, this will be `undefined`.
210+
* `filePath` string - If the dialog is canceled, this will be an empty string.
211211
* `bookmark` string (optional) _macOS_ _mas_ - Base64 encoded string which contains the security scoped bookmark data for the saved file. `securityScopedBookmarks` must be enabled for this to be present. (For return values, see [table here](#bookmarks-array).)
212212

213213
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.

0 commit comments

Comments
 (0)