From 2987a538194e79cf455530e4ccff2fb3876bb04d Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Wed, 3 Nov 2021 20:15:29 +0500 Subject: [PATCH] change save timer to 250ms --- apps/mobile/src/views/Editor/Functions.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/views/Editor/Functions.js b/apps/mobile/src/views/Editor/Functions.js index b6ceb1db5..2c0e2e136 100644 --- a/apps/mobile/src/views/Editor/Functions.js +++ b/apps/mobile/src/views/Editor/Functions.js @@ -456,7 +456,7 @@ function onNoteChange() { if (noteEdited) { saveNote(); } - }, 100); + }, 250); } let cTimeout = null; @@ -568,6 +568,8 @@ export async function saveNote(preventUpdate) { if (!noteEdited) return; if (isSaving && !id) return; isSaving = true; + console.log('saving note now', Date.now()); + try { if (id && !db.notes.note(id)) { clearNote(); @@ -582,7 +584,6 @@ export async function saveNote(preventUpdate) { } locked = _note.locked; } - let noteData = { title, content: { @@ -594,6 +595,10 @@ export async function saveNote(preventUpdate) { if (!locked) { let noteId = await db.notes.add(noteData); + + let _d = await db.content.raw(note.contentId); + + console.log("COTENT_STATUSS:", _d.data) if (!id || saveCounter < 3) { Navigation.setRoutesToUpdate([ Navigation.routeNames.Notes, @@ -734,12 +739,15 @@ const loadNoteInEditor = async (keepHistory = true) => { ` ); } else { + post('html', content.data); } if (id) { db.attachments.downloadImages(id); } + + setColors(); tiny.call( EditorWebView,