Fixed: Canceling editing a custom filter won't close the Custom filter modal
This commit is contained in:
parent
e359347a3b
commit
c47e7cd91d
|
@ -132,6 +132,7 @@ class FilterBuilderModalContent extends Component {
|
|||
filterBuilderProps,
|
||||
isSaving,
|
||||
saveError,
|
||||
onCancelPress,
|
||||
onModalClose
|
||||
} = this.props;
|
||||
|
||||
|
@ -190,7 +191,7 @@ class FilterBuilderModalContent extends Component {
|
|||
</ModalBody>
|
||||
|
||||
<ModalFooter>
|
||||
<Button onPress={onModalClose}>
|
||||
<Button onPress={onCancelPress}>
|
||||
Cancel
|
||||
</Button>
|
||||
|
||||
|
@ -220,6 +221,7 @@ FilterBuilderModalContent.propTypes = {
|
|||
dispatchDeleteCustomFilter: PropTypes.func.isRequired,
|
||||
onSaveCustomFilterPress: PropTypes.func.isRequired,
|
||||
dispatchSetFilter: PropTypes.func.isRequired,
|
||||
onCancelPress: PropTypes.func.isRequired,
|
||||
onModalClose: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
|
|
|
@ -34,6 +34,17 @@ class FilterModal extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
onCancelPress = () => {
|
||||
if (this.state.filterBuilder) {
|
||||
this.setState({
|
||||
filterBuilder: false,
|
||||
id: null
|
||||
});
|
||||
} else {
|
||||
this.onModalClose();
|
||||
}
|
||||
}
|
||||
|
||||
onModalClose = () => {
|
||||
this.setState({
|
||||
filterBuilder: false,
|
||||
|
@ -67,6 +78,7 @@ class FilterModal extends Component {
|
|||
<FilterBuilderModalContentConnector
|
||||
{...otherProps}
|
||||
id={id}
|
||||
onCancelPress={this.onCancelPress}
|
||||
onModalClose={this.onModalClose}
|
||||
/> :
|
||||
<CustomFiltersModalContentConnector
|
||||
|
|
Loading…
Reference in New Issue