fix(onboarding): AccountStore only listens to changes to account obj when window

type is composer

- AccountStore was listening to changes to account object (config file)
when it was a window different from the main window in order to update
the alias list on composer windows.
- This caused the onboarding window to also listen for changes and
caused it to incorrectly add an account twice
This commit is contained in:
Juan Tejada 2015-12-11 11:58:36 -08:00
parent 1a3c6eef68
commit 58cc141cdf
2 changed files with 4 additions and 1 deletions

View file

@ -35,7 +35,7 @@ class AccountStore
@_load()
if newAccountIds.length > 0
Actions.selectAccount(newAccountIds[0])
unless NylasEnv.isMainWindow()
if NylasEnv.isComposerWindow()
NylasEnv.config.observe saveObjectsKey, => @_load()
@_setupFastAccountCommands()

View file

@ -337,6 +337,9 @@ class NylasEnvConstructor extends Model
isWorkWindow: ->
@getWindowType() is 'work'
isComposerWindow: ->
@getWindowType() is 'composer'
getWindowType: ->
@getLoadSettings().windowType