Skip to content

Commit fbbd8a7

Browse files
author
djinni-hppro
committed
..
1 parent dd168b4 commit fbbd8a7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/helpers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,10 @@ async function syncDeletedNoteIds({deletedNoteIds, credentials, gitCredentials,
405405
});
406406

407407
// --- Upload Phase ---
408-
// 3. Only upload if the merged set differs from what we started with
409-
const hasChanged = remoteLists.length === 0
410-
? false // No remote providers, nothing to sync
411-
: (finalIds.size !== initialMasterIds.size || ![...finalIds].every(id => initialMasterIds.has(id)));
408+
// 3. Only upload if the merged list differs from what we had before
409+
// (compare against the most recent remote OR local if no remotes)
410+
const referenceIds = remoteLists.length > 0 ? initialMasterIds : new Set(deletedNoteIds);
411+
const hasChanged = finalIds.size !== referenceIds.size || ![...finalIds].every(id => referenceIds.has(id));
412412

413413
const finalIdArray = Array.from(finalIds).slice(-100);
414414

0 commit comments

Comments
 (0)