From 98e18a62e210c790c1dc3eb4c118b8e553789552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Salomv=C3=A1ry?= Date: Wed, 16 Nov 2016 10:35:02 +0100 Subject: [PATCH] Clarify docs on a `before-quit` behavior edge case See #7875 --- docs/api/app.md | 4 ++++ docs/api/auto-updater.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/api/app.md b/docs/api/app.md index 52c3738fb8ec..fb86ddd990f1 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -60,6 +60,10 @@ Emitted before the application starts closing its windows. Calling `event.preventDefault()` will prevent the default behaviour, which is terminating the application. +**Note:** If application quit was initiated by `autoUpdater.quitAndInstall()` +then `before-quit` is emitted *after* emitting `close` event on all windows and +closing them. + ### Event: 'will-quit' Returns: diff --git a/docs/api/auto-updater.md b/docs/api/auto-updater.md index 53d6b1373620..720e2896915f 100644 --- a/docs/api/auto-updater.md +++ b/docs/api/auto-updater.md @@ -121,6 +121,10 @@ using this API. Restarts the app and installs the update after it has been downloaded. It should only be called after `update-downloaded` has been emitted. +**Note:** `autoUpdater.quitAndInstall()` will close all application windows +first and only emit `before-quit` event on `app` after that. This is different +from the normal quit event sequence. + [squirrel-mac]: https://github.com/Squirrel/Squirrel.Mac [server-support]: https://github.com/Squirrel/Squirrel.Mac#server-support [squirrel-windows]: https://github.com/Squirrel/Squirrel.Windows