diff --git a/src/components/tree/legend/legend.js b/src/components/tree/legend/legend.js index e2442e750..109d1ab1a 100644 --- a/src/components/tree/legend/legend.js +++ b/src/components/tree/legend/legend.js @@ -23,6 +23,7 @@ class Legend extends React.Component { } showLegend() { + // redux state takes precedent if (this.props.legendOpen !== undefined) { return this.props.legendOpen; } // Our default state changes based on the size of the window or the number of items in the legend. diff --git a/src/middleware/changeURL.js b/src/middleware/changeURL.js index 186924c66..250509731 100644 --- a/src/middleware/changeURL.js +++ b/src/middleware/changeURL.js @@ -81,6 +81,13 @@ export const changeURLMiddleware = (store) => (next) => (action) => { } break; } + case types.TOGGLE_LEGEND: { + // we treat this the same as sidebar above -- it can only be added to the URL manually + if ("legend" in query) { + query.legend = undefined; + } + break; + } case types.TOGGLE_PANEL_DISPLAY: { if (state.controls.panelsAvailable.length === action.panelsToDisplay.length) { query.d = undefined;