From 0af18c9f2e19818aad4fe97e28ac0d3ed2d34cf3 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Fri, 21 Aug 2015 18:23:24 -0700 Subject: [PATCH] fix(add-account): Don't check for tokens from secondary windows --- src/browser/atom-window.coffee | 3 ++- src/flux/edgehill-api.coffee | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/browser/atom-window.coffee b/src/browser/atom-window.coffee index 9dbc881c8..6eaee6085 100644 --- a/src/browser/atom-window.coffee +++ b/src/browser/atom-window.coffee @@ -112,7 +112,8 @@ class AtomWindow setLoadSettings: (loadSettings) -> @browserWindow.loadSettings = loadSettings @browserWindow.loadSettingsChangedSinceGetURL = true - @browserWindow.webContents.send('load-settings-changed', loadSettings) if @loaded + if @loaded + @browserWindow.webContents.send('load-settings-changed', loadSettings) getUrl: (loadSettingsObj) -> # Ignore the windowState when passing loadSettings via URL, since it could diff --git a/src/flux/edgehill-api.coffee b/src/flux/edgehill-api.coffee index fd8f8a6a2..0f856aff8 100644 --- a/src/flux/edgehill-api.coffee +++ b/src/flux/edgehill-api.coffee @@ -14,9 +14,10 @@ class EdgehillAPI # Always ask Edgehill Server for our tokens at launch. This way accounts # added elsewhere will appear, and we'll also handle the 0.2.5=>0.3.0 upgrade. - existing = @_getCredentials() - if existing and existing.username - @setUserIdentifierAndRetrieveTokens(existing.username) + if atom.isMainWindow() + existing = @_getCredentials() + if existing and existing.username + @setUserIdentifierAndRetrieveTokens(existing.username) @