mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-11 15:34:27 +08:00
feat(sidebar): Add behavior to persist collapsed state of sidebar items
Summary: - Updates account sidebar to persist collapsed state to the the config Test Plan: - manual Reviewers: evan, bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D2276
This commit is contained in:
parent
abebd2ce55
commit
98bc9dc958
1 changed files with 2 additions and 1 deletions
|
@ -33,7 +33,7 @@ class AccountSidebar extends React.Component
|
|||
|
||||
constructor: (@props) ->
|
||||
@state = @_getStateFromStores()
|
||||
@state.collapsed = {}
|
||||
@state.collapsed = NylasEnv.config.get('core.accountSidebarCollapsed') ? {}
|
||||
|
||||
componentDidMount: =>
|
||||
@unsubscribers = []
|
||||
|
@ -111,6 +111,7 @@ class AccountSidebar extends React.Component
|
|||
_onToggleCollapsed: (itemId) =>
|
||||
collapsed = _.clone(@state.collapsed)
|
||||
collapsed[itemId] = !collapsed[itemId]
|
||||
NylasEnv.config.set('core.accountSidebarCollapsed', collapsed)
|
||||
@setState({collapsed})
|
||||
|
||||
_getStateFromStores: =>
|
||||
|
|
Loading…
Reference in a new issue