fix(accounts) Make account adding look fast

This commit is contained in:
Juan Tejada 2017-01-16 20:18:48 -08:00
parent b1882656ee
commit aa53484568

View file

@ -46,16 +46,17 @@ class AccountStore extends NylasStore {
if (newAccountIds.length > 0) { if (newAccountIds.length > 0) {
const newId = newAccountIds[0] const newId = newAccountIds[0]
const NylasSyncStatusStore = require('./nylas-sync-status-store').default // const NylasSyncStatusStore = require('./nylas-sync-status-store').default
NylasSyncStatusStore.whenCategoryListSynced(newId).then(() => { Actions.focusDefaultMailboxPerspectiveForAccounts([newId], {sidebarAccountIds: accountIds})
Actions.focusDefaultMailboxPerspectiveForAccounts([newId], {sidebarAccountIds: accountIds}) // TODO:
// TODO: This Action is a hack, get rid of it in sidebar refactor // Wait for a little bit before uncollapsong the sidebar to show the
// Wait until the FocusedPerspectiveStore triggers and the sidebar is // newly focused inbox
// updated to uncollapse the inbox for the new account // This Action is a hack, get rid of it in sidebar refactor
_.defer(() => { // Wait until the FocusedPerspectiveStore triggers and the sidebar is
Actions.setCollapsedSidebarItem('Inbox', false) // updated to uncollapse the inbox for the new account
}) setTimeout(() => {
}) Actions.setCollapsedSidebarItem('Inbox', false)
}, 100)
} }
}) })
} }