server: send new version on updater:check

This commit is contained in:
Chris Breiding
2017-06-22 10:59:54 -04:00
parent 3324864551
commit 268fc2644e
3 changed files with 5 additions and 5 deletions
@@ -79,7 +79,7 @@ class UpdateBanner extends Component {
ipc.offUpdaterCheck()
ipc.updaterCheck()
.then((version) => {
appStore.setNewVersion(version)
if (version) appStore.setNewVersion(version)
})
.catch((error) => {
console.warn('Error checking for updates:', error) // eslint-disable-line no-console
+1 -1
View File
@@ -113,7 +113,7 @@ handleEvent = (options, bus, event, id, type, arg) ->
when "updater:check"
Updater.check({
onNewVersion: -> send(true)
onNewVersion: ({ version }) -> send(version)
onNoNewVersion: -> send(false)
})
@@ -183,10 +183,10 @@ describe "lib/gui/events", ->
context "updating", ->
describe "updater:check", ->
it "returns true when new version", ->
@sandbox.stub(Updater, "check").yieldsTo("onNewVersion")
it "returns version when new version", ->
@sandbox.stub(Updater, "check").yieldsTo("onNewVersion", {version: "1.2.3"})
@handleEvent("updater:check")
@expectSendCalledWith(true)
@expectSendCalledWith("1.2.3")
it "returns false when no new version", ->
@sandbox.stub(Updater, "check").yieldsTo("onNoNewVersion")