From 6f3e0fcd04ee0942e1592016fe16f4cfcbd83b00 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Mon, 4 Jan 2021 13:11:00 +0500 Subject: [PATCH] fix data not updating on sync --- apps/mobile/src/components/LoginDialog/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/mobile/src/components/LoginDialog/index.js b/apps/mobile/src/components/LoginDialog/index.js index 71aeb6592..7d1dad692 100644 --- a/apps/mobile/src/components/LoginDialog/index.js +++ b/apps/mobile/src/components/LoginDialog/index.js @@ -192,12 +192,14 @@ const LoginDialog = () => { setStatus('Syncing Data'); dispatch({type: Actions.USER, user: user}); db.sync() - .catch((e) => {}) + .catch((e) => { + console.log(e); + }) .finally(async () => { dispatch({type: Actions.LAST_SYNC, lastSync: await db.lastSynced()}); + dispatch({type: Actions.ALL}); + eSendEvent(refreshNotesPage); }); - dispatch({type: Actions.ALL}); - eSendEvent(refreshNotesPage); clearMessage(dispatch); if (!user.isEmailConfirmed) { setEmailVerifyMessage(dispatch);