Skip to content

Commit

Permalink
panel-toggles: Add context to implicit behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin committed Sep 29, 2023
1 parent 46649ab commit dd37b3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/controls/panel-toggles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ export default function PanelToggles() {
const showTreeToo = useSelector((state: RootState) => state.controls.showTreeToo);

const panels = panelsAvailable.slice();

// Prevent map from being enabled when second tree is visible.
// It is disabled elsewhere.
if (showTreeToo && panels.indexOf("map") !== -1) {
panels.splice(panels.indexOf("map"), 1);
}

return <>
{panels.map((n) => (
<Toggle
Expand Down

0 comments on commit dd37b3f

Please sign in to comment.