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) {
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)
}
})
}