Send check-for-update message over ipc

This commit is contained in:
Daniel Hengeveld
2016-02-03 14:21:46 -08:00
committed by Ben Ogle
parent 44d7832745
commit 6fce680a28
3 changed files with 7 additions and 6 deletions

View File

@@ -304,6 +304,9 @@ class AtomApplication
ipcMain.on 'execute-javascript-in-dev-tools', (event, code) ->
event.sender.devToolsWebContents?.executeJavaScript(code)
ipcMain.on 'check-for-update', =>
@autoUpdateManager.check()
setupDockMenu: ->
if process.platform is 'darwin'
dockMenu = Menu.buildFromTemplate [

View File

@@ -3,6 +3,7 @@ _ = require 'underscore-plus'
Config = require '../config'
{EventEmitter} = require 'events'
path = require 'path'
ipc = require 'ipc'
IdleState = 'idle'
CheckingState = 'checking'
@@ -47,7 +48,7 @@ class AutoUpdateManager
autoUpdater.on 'update-available', =>
@setState(DownladingState)
# We use sendMessage to send an event called 'update-available' below
# We use sendMessage to send an event called 'update-available' in 'update-downloaded'
# once the update download is complete. This mismatch between the electron
# autoUpdater events is unfortunate but in the interest of not changing the
# one existing event handled by applicationDelegate

View File

@@ -1,6 +1,7 @@
'use babel'
import {Emitter, CompositeDisposable} from 'event-kit'
import ipc from 'ipc'
export default class Update {
constructor () {
@@ -55,10 +56,6 @@ export default class Update {
}
check () {
// TODO
}
getState () {
// TODO
ipc.send('check-for-update')
}
}