This commit is contained in:
henrydays 2019-02-05 15:47:19 +00:00
parent 4f37d34bb5
commit b30b76d655
3 changed files with 20 additions and 33 deletions

View File

@ -219,11 +219,7 @@ export function getUserInfo(token){
dispatch({ type: USER_INFO, user: obj,onHold:false, logged:true });
})
.then(function(resJson) {
dispatch({ type: USER_INFO, user: '',onHold:false, logged:true });
})
}

View File

@ -30,7 +30,7 @@ class Home extends Component {
token:{valid:false},
logged:true,
onHold:true,
user:{}
user:{Name:''}
};
@ -48,7 +48,7 @@ class Home extends Component {
//console.log('logged:'+this.props.logged);
//console.log(this.props)
//console.log(th2is.props)
//console.log(this.props.user)
@ -67,10 +67,14 @@ class Home extends Component {
// this.props.logout();
this.props.logoutUser();
}
update=()=>{
this.setState({ user: this.props.user });
console.log('update' +this.props.user);
}
render() {
console.log(this.props.user);
const { navigate } = this.props.navigation;
@ -86,8 +90,9 @@ class Home extends Component {
}
if(this.props.logged){
console.log(this.props.logged);
console.log(this.props.user);
console.log("puta que pariu")
return (
<View >
@ -96,9 +101,9 @@ class Home extends Component {
<Text> Nomess: {this.props.user.Name}</Text>
<View>
<Text>{this.props.user.Name}</Text>
<Text>{this.state.user.Name}</Text>
<Button onPress={this.bClick} title="LOGOUT"/>
<Button onPress={this.update} title="update"/>
</View>
<Text> city: {this.props.user.City}</Text>
<Text> phone: {this.props.user.Mobile}</Text>

28
App/package-lock.json generated
View File

@ -2953,13 +2953,11 @@
},
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"optional": true
"bundled": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -2972,18 +2970,15 @@
},
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"optional": true
"bundled": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"optional": true
"bundled": true
},
"core-util-is": {
"version": "1.0.2",
@ -3086,8 +3081,7 @@
},
"inherits": {
"version": "2.0.3",
"bundled": true,
"optional": true
"bundled": true
},
"ini": {
"version": "1.3.5",
@ -3097,7 +3091,6 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -3110,20 +3103,17 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"optional": true
"bundled": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@ -3140,7 +3130,6 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -3213,8 +3202,7 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"object-assign": {
"version": "4.1.1",
@ -3224,7 +3212,6 @@
"once": {
"version": "1.4.0",
"bundled": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -3330,7 +3317,6 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",