From 30d864ec3914adeae8b0cedf527e1e1d1c687078 Mon Sep 17 00:00:00 2001 From: Jover Lee Date: Tue, 29 Oct 2024 17:00:24 -0700 Subject: [PATCH] Hide measurements panel if loading failed --- src/actions/recomputeReduxState.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/actions/recomputeReduxState.js b/src/actions/recomputeReduxState.js index 6dcc52aa6..bb6020e06 100644 --- a/src/actions/recomputeReduxState.js +++ b/src/actions/recomputeReduxState.js @@ -923,6 +923,11 @@ export const createStateFromQueryOrJSONs = ({ measurements.collectionToDisplay = collectionToDisplay; controls = {...controls, ...collectionControls}; query = updatedQuery; + } else { + // Hide measurements panel if loading failed + controls.panelsToDisplay = controls.panelsToDisplay.filter((panel) => panel !== "measurements"); + controls.canTogglePanelLayout = hasMultipleGridPanels(controls.panelsToDisplay); + controls.panelLayout = controls.canTogglePanelLayout ? controls.panelLayout : "full"; } /* certain narrative slides prescribe the main panel to simply render narrative-provided markdown content */