diff --git a/ComApp/src/App/Views/ContactScreen.js b/ComApp/src/App/Views/ContactScreen.js index 3b69040..1df1ce5 100644 --- a/ComApp/src/App/Views/ContactScreen.js +++ b/ComApp/src/App/Views/ContactScreen.js @@ -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({