Skip to content

Commit

Permalink
Merge pull request #4 from basselAhmed/master
Browse files Browse the repository at this point in the history
Fix a bug when updating props
Thank you @basselAhmed , Never checked that case since we always had `VALUE` as `defaultValueType`.
  • Loading branch information
arajajyothibabu authored Nov 2, 2018
2 parents e67fd1f + fc86cb1 commit 383288b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
14 changes: 10 additions & 4 deletions lib/reactcohortgraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -2745,10 +2745,16 @@ var ReactCohortGraph = function (_React$Component) {
dataStore: store
});
} else {
this.setState({
currentType: currentDataType,
valueType: valueType
});
if (valueType) {
this.setState({
currentType: currentDataType,
valueType: valueType
});
} else {
this.setState({
currentType: currentDataType
});
}
}
if (typeof onStoreUpdate === 'function') {
onStoreUpdate(store, currentDataType, valueType);
Expand Down
2 changes: 1 addition & 1 deletion lib/reactcohortgraph.min.js

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions src/ReactCohortGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,16 @@ class ReactCohortGraph extends React.Component {
dataStore: store
});
}else{
this.setState({
currentType: currentDataType,
valueType: valueType
});
if (valueType) {
this.setState({
currentType: currentDataType,
valueType: valueType
});
} else {
this.setState({
currentType: currentDataType,
});
}
}
if(typeof onStoreUpdate === 'function') {
onStoreUpdate(store, currentDataType, valueType);
Expand Down

0 comments on commit 383288b

Please sign in to comment.