From dae7b0efd21f728081a9d1aa01db62901c846348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Mon, 4 Sep 2023 10:22:36 +0200 Subject: [PATCH] Fixes #45 Initilize docs before opening contact screen --- ComApp/src/App/Views/ContactScreen.js | 4 ++-- ComApp/src/App/Views/HomeScreen.js | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ComApp/src/App/Views/ContactScreen.js b/ComApp/src/App/Views/ContactScreen.js index c7bad2c..1b6539f 100644 --- a/ComApp/src/App/Views/ContactScreen.js +++ b/ComApp/src/App/Views/ContactScreen.js @@ -635,7 +635,7 @@ class ContactScreen extends React.Component { itemValue !== '-1' && this.state.sendDocumentList.length < 8 ) { - let tmp = this.state.sendDocumentList; + const tmp = this.state.sendDocumentList; const toPush = this.state.sortedDocuments[itemIndex - 1]; const test = this.state.sendDocumentList.filter( item => item.id === toPush.id, @@ -679,7 +679,7 @@ class ContactScreen extends React.Component { { - let tmp = this.state.sendDocumentList; + const tmp = this.state.sendDocumentList; tmp.splice(this.props.documents[index], 1); this.setState({ sendDocumentList: tmp, diff --git a/ComApp/src/App/Views/HomeScreen.js b/ComApp/src/App/Views/HomeScreen.js index eac84c7..b472994 100644 --- a/ComApp/src/App/Views/HomeScreen.js +++ b/ComApp/src/App/Views/HomeScreen.js @@ -109,7 +109,13 @@ class HomeScreen extends React.Component { this.props.navigation.navigate('ContactScreen')} + onPress={() => { + this.props.initDocuments( + this.props.locale, + this.props.directories.global, + ); + this.props.navigation.navigate('ContactScreen'); + }} style={styles.button}>