From 7beff5bae492ce571acae5affc4724ebc507baf0 Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Wed, 25 Jan 2017 15:06:47 -0800 Subject: [PATCH] fix(onboarding) Allow users who only have custom imap to auth Summary: Users who only had a custom imap account could not open the window to add a custom imap account the first time the auth was opened, rendering the app useless for them. Github issue #3185 and T7691 Test Plan: manual Reviewers: halla, spang, evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D3783 --- internal_packages/onboarding/lib/onboarding-store.es6 | 8 ++++++++ src/browser/application.es6 | 3 +++ 2 files changed, 11 insertions(+) diff --git a/internal_packages/onboarding/lib/onboarding-store.es6 b/internal_packages/onboarding/lib/onboarding-store.es6 index edcbfcf32..f3455c478 100644 --- a/internal_packages/onboarding/lib/onboarding-store.es6 +++ b/internal_packages/onboarding/lib/onboarding-store.es6 @@ -27,6 +27,14 @@ class OnboardingStore extends NylasStore { this.listenTo(OnboardingActions.authenticationJSONReceived, this._onAuthenticationJSONReceived) this.listenTo(OnboardingActions.setAccountInfo, this._onSetAccountInfo); this.listenTo(OnboardingActions.setAccountType, this._onSetAccountType); + ipcRenderer.on('set-account-type', (e, type) => { + if (type) { + this._onSetAccountType(type) + } else { + this._pageStack = ['account-choose'] + this.trigger() + } + }) const {existingAccount, addingAccount, accountType} = NylasEnv.getWindowProps(); diff --git a/src/browser/application.es6 b/src/browser/application.es6 index 5cf86b60a..11d2bce2c 100644 --- a/src/browser/application.es6 +++ b/src/browser/application.es6 @@ -298,6 +298,9 @@ export default class Application extends EventEmitter { this.on('application:add-account', ({existingAccount, accountType} = {}) => { const onboarding = this.windowManager.get(WindowManager.ONBOARDING_WINDOW); if (onboarding) { + if (onboarding.browserWindow.webContents) { + onboarding.browserWindow.webContents.send('set-account-type', accountType) + } onboarding.show(); onboarding.focus(); } else {