File tree Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -58,14 +58,14 @@ import './ObjectSummary.scss';
5858
5959const b = cn ( 'object-summary' ) ;
6060
61- const getInitialIsSummaryCollapsed = ( ) => {
62- return Boolean ( localStorage . getItem ( DEFAULT_IS_TENANT_COMMON_INFO_COLLAPSED ) ) ;
63- } ;
61+ const getTenantCommonInfoState = ( ) => {
62+ const collapsed = Boolean ( localStorage . getItem ( DEFAULT_IS_TENANT_COMMON_INFO_COLLAPSED ) ) ;
6463
65- const initialTenantCommonInfoState = {
66- triggerExpand : false ,
67- triggerCollapse : false ,
68- collapsed : getInitialIsSummaryCollapsed ( ) ,
64+ return {
65+ triggerExpand : false ,
66+ triggerCollapse : false ,
67+ collapsed,
68+ } ;
6969} ;
7070
7171function prepareOlapTableSchema ( tableSchema : TColumnTableDescription = { } ) {
@@ -109,7 +109,8 @@ export function ObjectSummary({
109109 const dispatch = useDispatch ( ) ;
110110 const [ commonInfoVisibilityState , dispatchCommonInfoVisibilityState ] = useReducer (
111111 paneVisibilityToggleReducerCreator ( DEFAULT_IS_TENANT_COMMON_INFO_COLLAPSED ) ,
112- initialTenantCommonInfoState ,
112+ undefined ,
113+ getTenantCommonInfoState ,
113114 ) ;
114115 const {
115116 data,
Original file line number Diff line number Diff line change @@ -27,14 +27,14 @@ import './Tenant.scss';
2727
2828const b = cn ( 'tenant-page' ) ;
2929
30- const getInitialIsSummaryCollapsed = ( ) => {
31- return Boolean ( localStorage . getItem ( DEFAULT_IS_TENANT_SUMMARY_COLLAPSED ) ) ;
32- } ;
30+ const getTenantSummaryState = ( ) => {
31+ const collapsed = Boolean ( localStorage . getItem ( DEFAULT_IS_TENANT_SUMMARY_COLLAPSED ) ) ;
3332
34- const initialTenantSummaryState = {
35- triggerExpand : false ,
36- triggerCollapse : false ,
37- collapsed : getInitialIsSummaryCollapsed ( ) ,
33+ return {
34+ triggerExpand : false ,
35+ triggerCollapse : false ,
36+ collapsed,
37+ } ;
3838} ;
3939
4040interface TenantProps {
@@ -45,7 +45,8 @@ interface TenantProps {
4545function Tenant ( props : TenantProps ) {
4646 const [ summaryVisibilityState , dispatchSummaryVisibilityAction ] = useReducer (
4747 paneVisibilityToggleReducerCreator ( DEFAULT_IS_TENANT_SUMMARY_COLLAPSED ) ,
48- initialTenantSummaryState ,
48+ undefined ,
49+ getTenantSummaryState ,
4950 ) ;
5051
5152 const { currentSchemaPath, currentSchema : currentItem = { } } = useSelector (
You can’t perform that action at this time.
0 commit comments