Skip to content

Commit

Permalink
fix(system-start): Do not continue when checkAvailability returns false
Browse files Browse the repository at this point in the history
  • Loading branch information
bengotow committed Feb 6, 2016
1 parent a582df2 commit 2383736
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions internal_packages/onboarding/lib/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions spec/mailbox-perspective-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -88,4 +88,3 @@ describe 'MailboxPerspective', ->
spyOn(@perspective, 'canArchiveThreads').andReturn false
@perspective.removeThreads(@threads)
expect(Actions.queueTasks).not.toHaveBeenCalled()

0 comments on commit 2383736

Please sign in to comment.