Rename events to be consistent
- Make State.save() always throttle calls -- since that's the common case. - Immediate saves are now the exception, with State.saveImmediate(). - The function is called State.save(), so the dispatch event should be 'stateSave'.
This commit is contained in:
@@ -102,8 +102,8 @@ function init () {
|
||||
|
||||
app.isQuitting = true
|
||||
e.preventDefault()
|
||||
windows.main.dispatch('saveState') // try to save state on exit
|
||||
ipcMain.once('savedState', () => app.quit())
|
||||
windows.main.dispatch('stateSaveImmediate') // try to save state on exit
|
||||
ipcMain.once('stateSaved', () => app.quit())
|
||||
setTimeout(() => {
|
||||
console.error('Saving state took too long. Quitting.')
|
||||
app.quit()
|
||||
|
||||
Reference in New Issue
Block a user