Skip to content

Commit b4d906b

Browse files
author
djinni-hppro
committed
fix delete
1 parent 14a0696 commit b4d906b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,8 +915,10 @@ document.addEventListener('alpine:init', () => { Alpine.data('mainApp', () => ({
915915
}
916916

917917
// S3/Nostr sync was successful, filter the pending deletions
918-
if (result.successfulDeletedIds) {
919-
this.deletedNoteIds = this.deletedNoteIds.filter(id => !result.successfulDeletedIds.includes(id));
918+
// We only remove IDs from the deletion queue if they are NO LONGER present on the remote.
919+
// If an ID is still in result.finalRemoteIds, it means the remote still had it when we started this sync.
920+
if (result.finalRemoteIds) {
921+
this.deletedNoteIds = this.deletedNoteIds.filter(id => result.finalRemoteIds.includes(id));
920922
localStorage.setItem('feathernote-deleted-note-ids', JSON.stringify(this.deletedNoteIds));
921923
}
922924
}

0 commit comments

Comments
 (0)