change save timer to 250ms

This commit is contained in:
ammarahm-ed
2021-11-03 20:15:29 +05:00
parent d345dfdd0e
commit 2987a53819

View File

@@ -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,