From 36e1cdad29db4646fd5bbfb4a3aafc0b26675b45 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Mon, 4 Jan 2021 14:54:44 +0500 Subject: [PATCH] refactor login page --- apps/mobile/src/components/LoginDialog/index.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/apps/mobile/src/components/LoginDialog/index.js b/apps/mobile/src/components/LoginDialog/index.js index e2d28bbfc..0ac6425c3 100644 --- a/apps/mobile/src/components/LoginDialog/index.js +++ b/apps/mobile/src/components/LoginDialog/index.js @@ -193,7 +193,6 @@ const LoginDialog = () => { dispatch({type: Actions.LAST_SYNC, lastSync: await db.lastSynced()}); dispatch({type: Actions.ALL}); eSendEvent(refreshNotesPage); - setLoading(false); close(); } catch (e) { setLoading(false); @@ -238,17 +237,7 @@ const LoginDialog = () => { setStatus('Creating User'); try { await db.user.signup(email, password); - } catch (e) { - setLoading(false); - setStatus(null); - console.log(e); - ToastEvent.show(e.message, 'error', 'local'); - return; - } - - let user; - try { - user = await db.user.getUser(); + let user = await db.user.getUser(); setStatus('Setting up crenditials'); dispatch({type: Actions.USER, user: user}); dispatch({type: Actions.LAST_SYNC, lastSync: await db.lastSynced()}); @@ -259,9 +248,8 @@ const LoginDialog = () => { eSendEvent(eOpenRecoveryKeyDialog, true); } catch (e) { setStatus(null); - ToastEvent.show(e.message, 'error', 'local'); - } finally { setLoading(false); + ToastEvent.show(e.message, 'error', 'local'); } };