fix(system-start): Do not continue when checkAvailability returns false

This commit is contained in:
Ben Gotow 2016-02-06 11:28:47 -08:00
parent 3c25434fc8
commit 12f4142d84
2 changed files with 5 additions and 5 deletions

View file

@ -14,8 +14,9 @@ module.exports =
ComponentRegistry.register PageRouter,
location: WorkspaceStore.Location.Center
startService = new SystemStartService()
if (NylasEnv.config.get('nylas.accounts')?.length ? 0) is 0
startService = new SystemStartService()
startService.checkAvailability().then (available) =>
startService.doesLaunchOnSystemStart().then (launchOnStart) =>
startService.configureToLaunchOnSystemStart() unless launchOnStart
return unless available
startService.doesLaunchOnSystemStart().then (launchesOnStart) =>
startService.configureToLaunchOnSystemStart() unless launchesOnStart

View file

@ -71,7 +71,7 @@ describe 'MailboxPerspective', ->
spyOn(@perspective, 'canArchiveThreads').andReturn true
spyOn(TaskFactory, 'tasksForMovingToInbox')
@perspective.removeThreads(@threads)
expect(TaskFactory.tasksForMovingToInbox).toHaveBeenCalledWith(@taskArgs)
expect(TaskFactory.tasksForMovingToInbox).toHaveBeenCalledWith({threads: @threads, fromPerspective: @perspective})
it 'removes categories if the current perspective does not correspond to archive or sent', ->
spyOn(@perspective, 'isInbox').andReturn false
@ -88,4 +88,3 @@ describe 'MailboxPerspective', ->
spyOn(@perspective, 'canArchiveThreads').andReturn false
@perspective.removeThreads(@threads)
expect(Actions.queueTasks).not.toHaveBeenCalled()