Skip to content

Commit

Permalink
fix(android): problem with alert
Browse files Browse the repository at this point in the history
  • Loading branch information
hopetambala committed Oct 24, 2020
1 parent 66cd6f1 commit 7a7be91
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions domains/Auth/SignIn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,16 @@ const SignIn = ({ navigation }) => {
});
}, [load]);

const handleFailedAttempt = (err) => {
const errorMsg = err.toString().slice(-26) || '';
const handleFailedAttempt = () => {
Alert.alert(
`${errorMsg}`,
'Your username or password may be incorrect, please try again.',
'Unable to login',
'Your username or password may be incorrect, please try again.', [
{ text: 'OK' }
],
{ cancelable: true }
);
};

const handleSignUp = () => {
navigation.navigate('Sign Up');
};
Expand Down Expand Up @@ -179,8 +181,8 @@ const SignIn = ({ navigation }) => {
handleSaveCredentials(values);
});
navigation.navigate('Root');
}, (err) => {
handleFailedAttempt(err);
}, () => {
handleFailedAttempt();
});
} else {
// offline
Expand Down

0 comments on commit 7a7be91

Please sign in to comment.