Move raw ipc calls into the applicationDelegate

This commit is contained in:
Ben Ogle
2016-03-01 14:59:41 -08:00
parent 4d11ff25d0
commit 492e89c8ff
2 changed files with 13 additions and 3 deletions

View File

@@ -235,3 +235,12 @@ class ApplicationDelegate
disablePinchToZoom: ->
webFrame.setZoomLevelLimits(1, 1)
checkForUpdate: ->
ipcRenderer.send('check-for-update')
restartAndInstallUpdate: ->
ipcRenderer.send('install-update')
getAutoUpdateManagerState: ->
ipcRenderer.sendSync('get-auto-update-manager-state')

View File

@@ -5,6 +5,7 @@ import {ipcRenderer} from 'electron'
export default class AutoUpdateManager {
constructor ({applicationDelegate}) {
this.applicationDelegate = applicationDelegate
this.subscriptions = new CompositeDisposable()
this.emitter = new Emitter()
@@ -30,15 +31,15 @@ export default class AutoUpdateManager {
}
checkForUpdate () {
ipcRenderer.send('check-for-update')
this.applicationDelegate.checkForUpdate()
}
restartAndInstallUpdate () {
ipcRenderer.send('install-update')
this.applicationDelegate.restartAndInstallUpdate()
}
getState () {
return ipcRenderer.sendSync('get-auto-update-manager-state')
return this.applicationDelegate.getAutoUpdateManagerState()
}
platformSupportsUpdates () {