mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
core: always send realtime sync event
This commit is contained in:
@@ -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)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user