Fixes #45 Initilize docs before opening contact screen
This commit is contained in:
parent
7d80af326b
commit
dae7b0efd2
2 changed files with 9 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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={{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue