From 38f52588c6d3a392ea5a9dad4eecb09ee73a155d Mon Sep 17 00:00:00 2001 From: Jitendra Gundaniya Date: Fri, 19 Jul 2024 20:22:37 +0100 Subject: [PATCH] Code review fix Signed-off-by: Jitendra Gundaniya --- src/reducers/index.js | 4 ++-- src/selectors/layout.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/reducers/index.js b/src/reducers/index.js index c657556fc6..86e92e02be 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -61,7 +61,7 @@ function resetDataReducer(state = {}, action) { * @param {Object} action Redux action * @return {Object} Updated state */ -function updateStateFromPropsReducer(state = {}, action) { +function updateStateFromOptionsReducer(state = {}, action) { if (action.type === UPDATE_STATE_FROM_OPTIONS) { return merge({}, state, action.payload); } @@ -120,7 +120,7 @@ const combinedReducer = combineReducers({ const rootReducer = (state, action) => { let newState = resetDataReducer(state, action); - newState = updateStateFromPropsReducer(newState, action); + newState = updateStateFromOptionsReducer(newState, action); return combinedReducer(newState, action); }; diff --git a/src/selectors/layout.js b/src/selectors/layout.js index 5d91a716fe..d275ac990e 100644 --- a/src/selectors/layout.js +++ b/src/selectors/layout.js @@ -13,7 +13,7 @@ import { const getSizeWarningFlag = (state) => state.flags.sizewarning; const getVisibleSidebar = (state) => state.visible.sidebar; -const getDisplayGlobalToolbar = (state) => state.display.globalToolbar; +const getDisplayGlobalNavigation = (state) => state.display.globalNavigation; const getDisplaySidebar = (state) => state.display.sidebar; const getVisibleCode = (state) => state.visible.code; const getIgnoreLargeWarning = (state) => state.ignoreLargeWarning; @@ -78,7 +78,7 @@ export const getChartSize = createSelector( getVisibleCode, getChartSizeState, getDisplaySidebar, - getDisplayGlobalToolbar, + getDisplayGlobalNavigation, ], ( visibleSidebar, @@ -86,7 +86,7 @@ export const getChartSize = createSelector( visibleCodeSidebar, chartSize, displaySidebar, - displayGlobalToolbar + displayGlobalNavigation ) => { const { left, top, width, height } = chartSize; if (!width || !height) { @@ -98,7 +98,7 @@ export const getChartSize = createSelector( // Get the actual sidebar width const sidebarWidthActual = - displaySidebar || displayGlobalToolbar + displaySidebar || displayGlobalNavigation ? getSidebarWidth(isSidebarVisible, sidebarWidth) : 0;