Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_close() {
Navigation.pop(this.props.componentId);
// Navigation.dismissModal(this.props.componentId);
}
if (showDeckUpgrade) {
Navigation.showModal({
stack: {
children: [{
component: {
name: 'Campaign.UpgradeDecks',
passProps,
},
}],
},
});
setTimeout(() => {
Navigation.pop(componentId);
}, 1500);
} else {
Navigation.pop(componentId);
}
}
}
onSavePressed() {
const {
componentId,
createWeaknessSet,
nextId,
} = this.props;
const {
name,
packs,
} = this.state;
createWeaknessSet(nextId, name, packs);
Navigation.pop(componentId);
}
componentWillReceiveProps (newProps) {
if (newProps.bloodPressure) {
this.setState({ bloodPressure: newProps.bloodPressure })
}
if (this.state.deleting && newProps.deleting === false) {
if (!newProps.errorDeleting) {
this.props.getAllBloodPressures()
Navigation.pop(this.props.componentId)
} else {
Alert.alert('Error', 'Something went wrong deleting the entity', [{text: 'OK'}])
this.setState({
success: false,
requesting: false
})
}
}
}
} else {
this.props.getAllBloodPressures({page: 0, sort: 'id,asc', size: 20})
const entityId = newProps.bloodPressure.id
const alertOptions = [{ text: 'OK' }]
if (!this.state.formValue.id) {
alertOptions.push({
text: 'View',
onPress: bloodPressureEntityDetailScreen.bind(this, { entityId })
})
}
this.setState({
success: true,
requesting: false,
formValue: { id: null }
})
Navigation.pop(this.props.componentId)
Alert.alert('Success', 'Entity saved successfully', alertOptions)
}
}
}
BackHandler.addEventListener('hardwareBackPress', () => {
Navigation.pop(this.props.componentId);
return true;
});
}
onHardwareBackPress() {
Navigation.pop(this.props.componentId);
return true;
}
navigationButtonPressed({ buttonId }: { buttonId: string }) {
const {
componentId,
} = this.props;
if (buttonId === 'back') {
Navigation.pop(componentId);
}
}
async onClickPop() {
await Navigation.pop(this.props.componentId);
}
navigationButtonPressed({ buttonId }: { buttonId: string }) {
const {
clearFilters,
filterId,
} = this.props;
if (buttonId === 'clear') {
clearFilters(filterId, clearTraits);
} else if (buttonId === 'apply') {
Navigation.pop(this.props.componentId);
}
}