Skip to content

Commit

Permalink
fixed drill down bug in layer panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlangstedt Anne authored and schlangstedt committed Aug 12, 2022
1 parent e883aee commit fdfc8a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion public/components/pages/layer_panel/layer_panel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import './layers.scss';
import { RootReducer } from '../../../reducer/root_reducer';
import { AnyAction, bindActionCreators, Dispatch } from 'redux';
Expand All @@ -17,6 +17,7 @@ interface LayerPanelProps {
setLayerAction: Function;
hideDrillDownGraph: Function;
hideNodeDetailPanel: Function;
rootReducer: RootReducer;
}

const mapStateToProps = (state: LayerPanelState) => {
Expand All @@ -26,6 +27,10 @@ const mapStateToProps = (state: LayerPanelState) => {
export function LayerPanelComponent(props: LayerPanelProps) {
const [currentLayer, setCurrentLayer] = useState<number>(1);

useEffect(() => {
setCurrentLayer(props.rootReducer.layer.selectedLayer);
}, [props.rootReducer.layer.selectedLayer]);

const changeLayer = (layer: number) => {
const { setLayerAction, hideDrillDownGraph, hideNodeDetailPanel } = props;
setCurrentLayer(layer);
Expand Down

0 comments on commit fdfc8a4

Please sign in to comment.