From 26b60b3591d2a2d9ef3cbda02260a172c81bf2f6 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Thu, 16 Feb 2023 15:40:14 -0500 Subject: [PATCH] Simplify getIsBottomBoxOpen selector. --- src/selectors/url-state.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/selectors/url-state.js b/src/selectors/url-state.js index c3a2c24649..33a1a0f27d 100644 --- a/src/selectors/url-state.js +++ b/src/selectors/url-state.js @@ -32,7 +32,6 @@ import type { ProfileSpecificUrlState, FullProfileSpecificUrlState, ActiveTabSpecificProfileUrlState, - IsOpenPerPanelState, } from 'firefox-profiler/types'; import type { TabSlug } from '../app-logic/tabs-handling'; @@ -81,9 +80,6 @@ export const getSourceViewFile: Selector = (state) => getProfileSpecificState(state).sourceView.file; export const getSourceViewActivationGeneration: Selector = (state) => getProfileSpecificState(state).sourceView.activationGeneration; -export const getisBottomBoxOpenPerPanel: Selector = ( - state -) => getProfileSpecificState(state).isBottomBoxOpenPerPanel; export const getShowJsTracerSummary: Selector = (state) => getFullProfileSpecificState(state).showJsTracerSummary; export const getTimelineTrackOrganization: Selector< @@ -216,12 +212,10 @@ export const getTransformStack: DangerousSelectorWithArguments< ); }; -export const getIsBottomBoxOpen: Selector = createSelector( - getisBottomBoxOpenPerPanel, - getSelectedTab, - (isBottomBoxOpenPerPanel, selectedTabSlug) => - isBottomBoxOpenPerPanel[selectedTabSlug] -); +export const getIsBottomBoxOpen: Selector = (state) => { + const tab = getSelectedTab(state); + return getProfileSpecificState(state).isBottomBoxOpenPerPanel[tab]; +}; /** * The URL predictor is used to generate a link for an uploaded profile, to predict