Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix login flow for user

ammarahm-ed3aec202ca5d4
diff --git a/apps/mobile/src/components/LoginDialog/index.js b/apps/mobile/src/components/LoginDialog/index.js
index e59f71cac..bd70ceac3 100644
--- a/apps/mobile/src/components/LoginDialog/index.js
+++ b/apps/mobile/src/components/LoginDialog/index.js
@@ -142,7 +142,7 @@ const LoginDialog = () => {
function open(mode) {
setMode(mode ? mode : MODES.login);
-
+ setStatus(null);
setVisible(true);
}
@@ -161,6 +161,7 @@ const LoginDialog = () => {
setUserConsent(false);
setError(false);
setLoading(false);
+ setStatus(null);
setMode(MODES.login);
};
@@ -195,7 +196,7 @@ const LoginDialog = () => {
eSendEvent(refreshNotesPage);
clearMessage(dispatch);
close();
- ToastEvent.show(`Logged in as ${email}`, 'success', 'local');
+ ToastEvent.show(`Logged in as ${user.email}`, 'success', 'global');
} catch (e) {
console.warn(e);
setStatus(null);
@@ -284,6 +285,8 @@ const LoginDialog = () => {
await MMKV.setItem('lastRecoveryEmailTime', JSON.stringify(Date.now()));
await db.user.recoverAccount(email);
} catch (e) {
+ setStatus(null);
+
ToastEvent.show(e.message, 'error', 'local');
}
setStatus('Account Recovery Email Sent!');
@@ -299,6 +302,8 @@ const LoginDialog = () => {
try {
await db.user.changePassword(oldPassword, password);
} catch (e) {
+
+ setStatus(null);
ToastEvent.show(e.message, 'error', 'local');
}
setStatus(null);
diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js
index 142682326..06a74507d 100644
--- a/apps/mobile/src/views/Settings/index.js
+++ b/apps/mobile/src/views/Settings/index.js
@@ -237,6 +237,7 @@ const AccoutLogoutSection = () => {
dispatch({type: Actions.CLEAR_ALL});
dispatch({type: Actions.SYNCING, syncing: false});
setLoginMessage(dispatch);
+ setVisible(false);
}}
/>
</DialogContainer>