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
This commit is contained in:
Juan Tejada 2017-01-25 15:06:47 -08:00
parent 7bf8d18a02
commit 7beff5bae4
2 changed files with 11 additions and 0 deletions

View file

@ -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();

View file

@ -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 {