Fix add contact from HomeScreen Error
This commit is contained in:
parent
f9a66aff00
commit
ce52471941
1 changed files with 9 additions and 6 deletions
|
|
@ -312,6 +312,13 @@ class ContactScreen extends React.Component {
|
|||
return objDocs[key];
|
||||
});
|
||||
|
||||
const { action } = this.props.route.params;
|
||||
if (action === 'add') {
|
||||
this.props.navigation.navigate('ContactDetailsScreen', {
|
||||
action: 'add',
|
||||
});
|
||||
}
|
||||
|
||||
this.setState({
|
||||
contacts: arrayContacts.sort(Helpers.compareValues('name', 'asc')),
|
||||
sortedDocuments: arrayDocs.sort(Helpers.compareValues('title', 'asc')),
|
||||
|
|
@ -322,12 +329,8 @@ class ContactScreen extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { contactAdded, action } = this.props.route.params;
|
||||
if (action === 'add') {
|
||||
this.props.navigation.navigate('ContactDetailsScreen', {
|
||||
action: 'add',
|
||||
});
|
||||
}
|
||||
const { contactAdded } = this.props.route.params;
|
||||
|
||||
if (contactAdded === true) {
|
||||
this.props.navigation.setParams({ contactAdded: false });
|
||||
showMessage({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue