Skip to content

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

fix seemless sync

ammarahm-ed434d53736f59
diff --git a/apps/mobile/AppRootEvents.js b/apps/mobile/AppRootEvents.js
index 94c52951b..8832e95c3 100644
--- a/apps/mobile/AppRootEvents.js
+++ b/apps/mobile/AppRootEvents.js
@@ -201,10 +201,10 @@ export const AppRootEvents = React.memo(
const onSyncComplete = async () => {
initialize();
+ setLastSynced(await db.lastSynced());
if (getNote()) {
- //updateNoteInEditor();
+ await updateNoteInEditor();
}
- setLastSynced(await db.lastSynced());
};
const onUrlRecieved = async res => {
diff --git a/apps/mobile/src/services/Sync.js b/apps/mobile/src/services/Sync.js
index 8fd1f2573..b924592a9 100644
--- a/apps/mobile/src/services/Sync.js
+++ b/apps/mobile/src/services/Sync.js
@@ -3,6 +3,7 @@ import {initialize, useUserStore} from '../provider/stores';
import {doInBackground} from '../utils';
import {db} from '../utils/DB';
import {eOpenLoginDialog} from '../utils/Events';
+import { getNote, updateNoteInEditor } from '../views/Editor/Functions';
import {eSendEvent, ToastEvent} from './EventManager';
const run = async (context = 'global', forced) => {
@@ -52,6 +53,9 @@ const run = async (context = 'global', forced) => {
} finally {
userstore.setLastSynced(await db.lastSynced());
initialize();
+ if (getNote()) {
+ await updateNoteInEditor();
+ }
userstore.setSyncing(false);
}
};