mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-02 20:21:19 +02:00
change save timer to 250ms
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user