From aa53484568f93bfc00ae188c46d3b489e5719fd5 Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Mon, 16 Jan 2017 20:18:48 -0800 Subject: [PATCH] fix(accounts) Make account adding look fast --- src/flux/stores/account-store.es6 | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/flux/stores/account-store.es6 b/src/flux/stores/account-store.es6 index 0062faa84..35263c608 100644 --- a/src/flux/stores/account-store.es6 +++ b/src/flux/stores/account-store.es6 @@ -46,16 +46,17 @@ class AccountStore extends NylasStore { if (newAccountIds.length > 0) { const newId = newAccountIds[0] - const NylasSyncStatusStore = require('./nylas-sync-status-store').default - NylasSyncStatusStore.whenCategoryListSynced(newId).then(() => { - Actions.focusDefaultMailboxPerspectiveForAccounts([newId], {sidebarAccountIds: accountIds}) - // TODO: This Action is a hack, get rid of it in sidebar refactor - // Wait until the FocusedPerspectiveStore triggers and the sidebar is - // updated to uncollapse the inbox for the new account - _.defer(() => { - Actions.setCollapsedSidebarItem('Inbox', false) - }) - }) + // const NylasSyncStatusStore = require('./nylas-sync-status-store').default + Actions.focusDefaultMailboxPerspectiveForAccounts([newId], {sidebarAccountIds: accountIds}) + // TODO: + // Wait for a little bit before uncollapsong the sidebar to show the + // newly focused inbox + // This Action is a hack, get rid of it in sidebar refactor + // Wait until the FocusedPerspectiveStore triggers and the sidebar is + // updated to uncollapse the inbox for the new account + setTimeout(() => { + Actions.setCollapsedSidebarItem('Inbox', false) + }, 100) } }) }