Add mechanism to get the AutoUpdateManager's state

This commit is contained in:
Ben Ogle
2016-02-26 16:38:56 -08:00
parent 7a1ad8263a
commit 3a32b30d5a
2 changed files with 7 additions and 0 deletions

View File

@@ -37,6 +37,10 @@ export default class AutoUpdateManager {
ipcRenderer.send('install-update')
}
getState () {
return ipcRenderer.sendSync('get-auto-update-manager-state')
}
platformSupportsUpdates () {
return this.getReleaseChannel() == 'stable' && (this.getPlatform() === 'darwin' || this.getPlatform() === 'win32')
}

View File

@@ -307,6 +307,9 @@ class AtomApplication
ipcMain.on 'check-for-update', =>
@autoUpdateManager.check()
ipcMain.on 'get-auto-update-manager-state', (event) =>
event.returnValue = @autoUpdateManager.getState()
ipcMain.on 'execute-javascript-in-dev-tools', (event, code) ->
event.sender.devToolsWebContents?.executeJavaScript(code)