core: always send realtime sync event

This commit is contained in:
Abdullah Atta
2023-12-11 10:57:11 +05:00
parent b7ecb7b6fb
commit 2fe8c87caa

View File

@@ -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)
);