Commit 05fc9b1f authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

update login

parent c30397c9
...@@ -35,6 +35,9 @@ class Login extends Component { ...@@ -35,6 +35,9 @@ class Login extends Component {
componentDidMount() { componentDidMount() {
this.getUser() this.getUser()
// localStorage.clear()
var email = localStorage.getItem(Constant.EMAIL)
console.log(email)
} }
handleChange(e) { handleChange(e) {
...@@ -95,7 +98,9 @@ class Login extends Component { ...@@ -95,7 +98,9 @@ class Login extends Component {
getUser() { getUser() {
var email = localStorage.getItem(Constant.EMAIL) var email = localStorage.getItem(Constant.EMAIL)
var password = localStorage.getItem(Constant.PASSWORD) var password = localStorage.getItem(Constant.PASSWORD)
if (email != '' && password != '') { if (email == null || password == null) {
this.setState({email: '', password: ''})
} else if(email != '' && password != ''){
this.setState({email, password}) this.setState({email, password})
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment