Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
break;
}
Alert.alert(
`Speichern war nicht möglich – wähle mindestens ${indefiniteArticle} ${filterTitle} aus`,
);
return false;
}
const jsonString = JSON.stringify(this.state.data);
await AsyncStorage.setItem(STORAGE_KEY, jsonString);
this.props.setFilters({
variables: { filters: jsonString },
refetchQueries: [{ query: GET_FILTERS }],
});
Navigation.dismissModal({
animationType: 'slide-down', // 'none' / 'slide-down' , dismiss animation for the modal (optional, default 'slide-down')
});
return true;
};
componentWillReceiveProps (newProps) {
// Did the login attempt complete?
if (!newProps.fetching) {
if (newProps.error) {
if (newProps.error === 'WRONG') {
Alert.alert('Error', 'Invalid login', [{text: 'OK'}])
}
} else if (newProps.account) {
Navigation.dismissModal(this.props.componentId)
}
}
}
dismiss() {
Keyboard.dismiss();
Navigation.dismissModal(this.props.componentId);
}
back() {
Navigation.dismissModal();
}
navigationButtonPressed({ buttonId }) {
if (buttonId === 'upload') {
if (!this.props.isConnected) {
this.props.showNotConnectedNotification();
return;
}
const { reportName, uploadReport, componentId } = this.props;
uploadReport(reportName);
Navigation.dismissModal(componentId);
}
if (buttonId === 'backButton') {
Navigation.dismissModal(this.props.componentId);
}
}
onClickDismissModal = () => {
Navigation.dismissModal(this.props.componentId);
}
onPress: () => {
if (saveReport) {
saveReport(reportName, {
status: CONSTANTS.status.draft
});
}
tracker.trackReportFlowEndedEvent(REPORT_OUTCOME_SAVED);
Navigation.dismissModal(componentId);
}
}
onCancel={() => Navigation.dismissModal(componentId)}
post={post}
onClose() {
StatusBar.setBarStyle('dark-content', true);
Navigation.dismissModal({
animationType: 'slide-down',
});
}
render() {
<button title="Close modal"> Navigation.dismissModal(componentId)} />
</button>