Skip to content

Commit

Permalink
Merge pull request electron#12619 from electron/add-before-update-event
Browse files Browse the repository at this point in the history
add new event to auto-updater
  • Loading branch information
zeke authored Apr 16, 2018
2 parents d06c79f + 4cb41ac commit 40ff17c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions atom/browser/api/atom_api_auto_updater.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ void AutoUpdater::SetFeedURL(mate::Arguments* args) {
}

void AutoUpdater::QuitAndInstall() {
Emit("before-quit-for-update");

// If we don't have any window then quitAndInstall immediately.
if (WindowList::IsEmpty()) {
auto_updater::AutoUpdater::QuitAndInstall();
Expand Down
6 changes: 6 additions & 0 deletions docs/api/auto-updater.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ Emitted when an update has been downloaded.

On Windows only `releaseName` is available.

### Event: 'before-quit-for-update'

This event is emitted after a user calls `quitAndInstall()`.

When this API is called, the `before-quit` event is not emitted before all windows are closed. As a result you should listen to this event if you wish to perform actions before the windows are closed while a process is quitting, as well as listening to `before-quit`.

## Methods

The `autoUpdater` object has the following methods:
Expand Down

0 comments on commit 40ff17c

Please sign in to comment.