Skip to content

Build your personal knowledge base with Trilium Notes

fix extra refresh because of duplicated sync event, closes #1063

zadam75bd395669ed
diff --git a/src/public/app/services/ws.js b/src/public/app/services/ws.js
index 3ddb70bc96..4e1e363028 100644
--- a/src/public/app/services/ws.js
+++ b/src/public/app/services/ws.js
@@ -165,6 +165,10 @@ async function consumeSyncData() {
utils.reloadApp();
}
+ for (const syncRow of nonProcessedSyncRows) {
+ processedSyncIds.add(syncRow.id);
+ }
+
lastProcessedSyncId = Math.max(lastProcessedSyncId, allSyncRows[allSyncRows.length - 1].id);
}
diff --git a/src/services/notes.js b/src/services/notes.js
index a04164ef54..3fa001c125 100644
--- a/src/services/notes.js
+++ b/src/services/notes.js
@@ -662,7 +662,9 @@ async function scanForLinks(note) {
const content = await note.getContent();
const newContent = await saveLinks(note, content);
- await note.setContent(newContent);
+ if (content !== newContent) {
+ await note.setContent(newContent);
+ }
}
catch (e) {
log.error(`Could not scan for links note ${note.noteId}: ${e.message} ${e.stack}`);