A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix login page
ammarahm-edf3c29ece02dd
diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.jsindex b0732bb24..ed8f9ab2b 100644--- a/apps/mobile/src/components/Menu/index.js+++ b/apps/mobile/src/components/Menu/index.js@@ -606,6 +606,8 @@ export const Menu = ({DDS.isTab? eSendEvent(eOpenLoginDialog): NavigationService.navigate('Login');++ close();}}activeOpacity={opacity / 2}style={{diff --git a/apps/mobile/src/views/Login/index.js b/apps/mobile/src/views/Login/index.jsindex 8fee26a57..fa9c18908 100644--- a/apps/mobile/src/views/Login/index.js+++ b/apps/mobile/src/views/Login/index.js@@ -39,7 +39,7 @@ export const Login = ({navigation}) => {const [invalidPassword, setInvalidPassword] = useState(false);const [username, setUsername] = useState('ammarahmed');const [invalidUsername, setInvalidUsername] = useState(false);-+ const [loginError, setLoginError] = useState(false);const isFocused = useIsFocused();useEffect(() => {@@ -76,11 +76,6 @@ export const Login = ({navigation}) => {_username.current.blur();_pass.current.blur();- setTimeout(() => {- setTimeout(() => {- navigation.navigate('Home');- }, 500);- }, 300);setStatus('Logging in...');if (!invalidPassword && !invalidUsername) {@@ -89,7 +84,11 @@ export const Login = ({navigation}) => {await db.user.login(username, password);} catch (e) {console.log(e, 'ERROR');+ ToastEvent.show('Network error, failed to login', 'error');+ setLoginError(true);+setLoggingIn(false);+ return;}let user;@@ -100,13 +99,16 @@ export const Login = ({navigation}) => {console.log('user', user);dispatch({type: ACTIONS.USER, user: user});ToastEvent.show(`Logged in as ${'ammarahmed'}`, 'success');+ navigation.goBack();} catch (e) {console.log(e, 'getUSer');+ setLoginError(true);ToastEvent.show(`Login Failed`, 'error');}console.log(user);} else {+ setLoginError(true);ToastEvent.show('Login failed', 'error');}};