Fixes #45 Initilize docs before opening contact screen

This commit is contained in:
Jérémy Munsch 2023-09-04 10:22:36 +02:00
parent 7d80af326b
commit dae7b0efd2
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
2 changed files with 9 additions and 3 deletions

View file

@ -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 {
<TouchableOpacity
key={index}
onPress={() => {
let tmp = this.state.sendDocumentList;
const tmp = this.state.sendDocumentList;
tmp.splice(this.props.documents[index], 1);
this.setState({
sendDocumentList: tmp,

View file

@ -109,7 +109,13 @@ class HomeScreen extends React.Component {
</TouchableOpacity>
<TouchableOpacity
key={'Contacts'}
onPress={() => this.props.navigation.navigate('ContactScreen')}
onPress={() => {
this.props.initDocuments(
this.props.locale,
this.props.directories.global,
);
this.props.navigation.navigate('ContactScreen');
}}
style={styles.button}>
<Image
source={{