From 41c1ec725f93407becd83866f803deb0d864adeb Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Mon, 14 Sep 2020 13:34:55 +0500 Subject: [PATCH] fix login toasts --- apps/mobile/src/components/LoginDialog/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/mobile/src/components/LoginDialog/index.js b/apps/mobile/src/components/LoginDialog/index.js index 67736fb42..e0f38672e 100644 --- a/apps/mobile/src/components/LoginDialog/index.js +++ b/apps/mobile/src/components/LoginDialog/index.js @@ -79,9 +79,10 @@ const LoginDialog = () => { invalidPassword || invalidUsername ) { - ToastEvent.show('username or password is invalid', 'error'); + ToastEvent.show('username or password is invalid', 'error', 'local'); return; } + setLoggingIn(true); _username.current.blur(); _pass.current.blur(); @@ -92,7 +93,7 @@ const LoginDialog = () => { console.log(res, username, password); } catch (e) { setTimeout(() => { - ToastEvent.show(e.message, 'error'); + ToastEvent.show(e.message, 'error', 'local'); setLoggingIn(false); }, 500); @@ -114,7 +115,7 @@ const LoginDialog = () => { eSendEvent(refreshNotesPage); setVisible(false); dispatch({type: ACTIONS.SYNCING, syncing: false}); - ToastEvent.show(`Logged in as ${username}`, 'success'); + ToastEvent.show(`Logged in as ${username}`, 'success', 'local'); } catch (e) { dispatch({type: ACTIONS.SYNCING, syncing: false}); setLoggingIn(false); @@ -223,6 +224,7 @@ const LoginDialog = () => { backgroundColor: colors.bg, justifyContent: 'center', }}> + {loggingIn || signingIn ? ( modalVisible ? ( { )} -