diff --git a/internal_packages/account-sidebar/lib/sidebar-store.coffee b/internal_packages/account-sidebar/lib/sidebar-store.coffee index c46614fd0..8dd50cd30 100644 --- a/internal_packages/account-sidebar/lib/sidebar-store.coffee +++ b/internal_packages/account-sidebar/lib/sidebar-store.coffee @@ -39,8 +39,8 @@ class SidebarStore extends NylasStore _registerListeners: -> @listenTo SidebarActions.focusAccounts, @_onAccountsFocused + @listenTo AccountStore, @_onAccountsChanged @listenTo FocusedPerspectiveStore, @_updateSections - @listenTo AccountStore, @_updateSections @listenTo WorkspaceStore, @_updateSections @listenTo ThreadCountsStore, @_updateSections @listenTo CategoryStore, @_updateSections @@ -60,6 +60,10 @@ class SidebarStore extends NylasStore @_focusedAccounts = accounts @_updateSections() + _onAccountsChanged: => + @_focusedAccounts = AccountStore.accounts() + @_updateSections() + _updateSections: => accounts = @_focusedAccounts multiAccount = accounts.length > 1