Enable the quitAndInstall to be cancelled by beforeunload handler.
This commit is contained in:
parent
07fc2b41af
commit
274c9d04b1
3 changed files with 2 additions and 17 deletions
|
@ -81,10 +81,8 @@ void AutoUpdater::QuitAndInstall(
|
||||||
const v8::FunctionCallbackInfo<v8::Value>& args) {
|
const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||||
AutoUpdater* self = AutoUpdater::Unwrap<AutoUpdater>(args.This());
|
AutoUpdater* self = AutoUpdater::Unwrap<AutoUpdater>(args.This());
|
||||||
|
|
||||||
if (!self->quit_and_install_.is_null()) {
|
if (!self->quit_and_install_.is_null())
|
||||||
self->quit_and_install_.Run();
|
self->quit_and_install_.Run();
|
||||||
self->quit_and_install_.Reset();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
|
@ -20,9 +20,6 @@ autoUpdater.quitAndInstall = ->
|
||||||
app = require 'app'
|
app = require 'app'
|
||||||
app.removeAllListeners 'window-all-closed'
|
app.removeAllListeners 'window-all-closed'
|
||||||
app.once 'window-all-closed', AutoUpdater::quitAndInstall.bind(this)
|
app.once 'window-all-closed', AutoUpdater::quitAndInstall.bind(this)
|
||||||
|
win.close() for win in windows
|
||||||
# Tell all windows to remove beforeunload handler and then close itself.
|
|
||||||
ipc = require 'ipc'
|
|
||||||
ipc.sendChannel win, 'ATOM_SHELL_SILENT_CLOSE' for win in windows
|
|
||||||
|
|
||||||
module.exports = autoUpdater
|
module.exports = autoUpdater
|
||||||
|
|
|
@ -50,16 +50,6 @@ window.onerror = (error) ->
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
|
|
||||||
# Enable browser to close window silently.
|
|
||||||
setTimeout ->
|
|
||||||
require('ipc').once 'ATOM_SHELL_SILENT_CLOSE', ->
|
|
||||||
window.onbeforeunload = null
|
|
||||||
window.close()
|
|
||||||
|
|
||||||
# Override default window.close.
|
|
||||||
window.close = ->
|
|
||||||
require('remote').getCurrentWindow().close()
|
|
||||||
|
|
||||||
# Override default window.open.
|
# Override default window.open.
|
||||||
window.open = (url, name, features) ->
|
window.open = (url, name, features) ->
|
||||||
options = {}
|
options = {}
|
||||||
|
|
Loading…
Reference in a new issue