From 98bc9dc958c0ce9206da0f8e1b7c174d4b5c7175 Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Wed, 18 Nov 2015 16:25:07 -0800 Subject: [PATCH] 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 --- internal_packages/account-sidebar/lib/account-sidebar.cjsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal_packages/account-sidebar/lib/account-sidebar.cjsx b/internal_packages/account-sidebar/lib/account-sidebar.cjsx index 48997b3d3..51686b522 100644 --- a/internal_packages/account-sidebar/lib/account-sidebar.cjsx +++ b/internal_packages/account-sidebar/lib/account-sidebar.cjsx @@ -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: =>