Removed all Example variables, added credential fail handler

This commit is contained in:
Leoh 2021-10-17 17:40:37 +05:30
parent cd3c81cf5c
commit 6b715682f9
7 changed files with 82 additions and 89 deletions

View file

@ -34,13 +34,18 @@ class App extends React.Component<any,any> {
.then(res => res.json())
.then(
result => {
console.log(result)
console.log("data reloaded")
this.setState({
isLoaded: true,
user_data: result,
todos: result.tasks.todos
})
if(result.success === false){
this.sendNotice("Login Failed, Please check credentials and try again!")
console.log(result)
} else {
console.log(result)
console.log("data reloaded")
this.setState({
isLoaded: true,
user_data: result,
todos: result.tasks.todos
})
}
},
(error) => {
this.setState({