Skip to content

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

core: always send realtime sync event

Abdullah Atta2fe8c87caa8a
diff --git a/packages/core/src/api/sync/index.ts b/packages/core/src/api/sync/index.ts
index 04cc72273..c3aaeb69c 100644
--- a/packages/core/src/api/sync/index.ts
+++ b/packages/core/src/api/sync/index.ts
@@ -224,7 +224,7 @@ class Sync {
this.connection.off("SendItems");
this.connection.on("SendItems", async (chunk) => {
if (this.connection.state !== signalr.HubConnectionState.Connected)
- return;
+ return false;
await this.processChunk(chunk, key);
@@ -324,11 +324,7 @@ class Sync {
this.db.eventManager.publish(EVENTS.databaseSyncRequested, true, false);
}
- async processChunk(
- chunk: SyncTransferItem,
- key: SerializedKey,
- notify = false
- ) {
+ async processChunk(chunk: SyncTransferItem, key: SerializedKey) {
const itemType = chunk.type;
if (itemType === "settings") return;
@@ -365,11 +361,7 @@ class Sync {
);
}
- if (
- notify &&
- (itemType === "note" || itemType === "content") &&
- items.length > 0
- ) {
+ if ((itemType === "note" || itemType === "content") && items.length > 0) {
items.forEach((item) =>
this.db.eventManager.publish(EVENTS.syncItemMerged, item)
);