Преглед изворни кода

update app/pages/home/maps/Filter.js

wudebin пре 4 месеци
родитељ
комит
50300127c5
1 измењених фајлова са 6 додато и 2 уклоњено
  1. 6 2
      Strides-APP/app/pages/home/maps/Filter.js

+ 6 - 2
Strides-APP/app/pages/home/maps/Filter.js

@@ -37,7 +37,7 @@ class Filter extends React.Component {
   }
 
   componentDidMount() {
-    if (this.props.index.connectorIndex || this.props.index.parkingIndex) {
+    if (this.props.index) {
       this.setState({
         filterIndex: this.props.index
       });
@@ -49,7 +49,11 @@ class Filter extends React.Component {
 
   selectConnector(index) {
     const indexs = this.state.filterIndex;
-    indexs.connectorIndex = index;
+    if (indexs.connectorIndex == index) {
+      indexs.connectorIndex = -1;
+    } else {
+      indexs.connectorIndex = index;
+    }
     this.setState({
       count: 0,
       filterIndex: indexs