diff --git a/apps/red-ui/src/app/screens/file/model/file-data.model.ts b/apps/red-ui/src/app/screens/file/model/file-data.model.ts index 4a3d055ff..229881074 100644 --- a/apps/red-ui/src/app/screens/file/model/file-data.model.ts +++ b/apps/red-ui/src/app/screens/file/model/file-data.model.ts @@ -43,7 +43,7 @@ export class FileDataModel { }); } - let visibleAnnotations = allAnnotations.filter((annotation) => { + const visibleAnnotations = allAnnotations.filter((annotation) => { if (viewMode === 'STANDARD') { return !annotation.isChangeLogRemoved; } else if (viewMode === 'DELTA') { @@ -63,11 +63,15 @@ export class FileDataModel { let result: RedactionLogEntryWrapper[] = []; this.redactionChangeLog?.redactionLogEntry?.forEach((changeLogEntry) => { - if (changeLogEntry.id === '48a8c973d0ef86bda58bf9722b931fc2') { - console.log(changeLogEntry); - // const existingChangeLogEntry = this.redactionChangeLog.redactionLogEntry.find((rle) => rle.id === redactionLogEntry.id); - } if (changeLogEntry.changeType === 'REMOVED') { + // Fix backend issue where some annotations are both added and removed + const sameEntryExistsAsAdd = !!this.redactionChangeLog.redactionLogEntry.find( + (rle) => rle.id === changeLogEntry.id && rle.changeType === 'ADDED' + ); + if (sameEntryExistsAsAdd) { + return; + } + const redactionLogEntryWrapper: RedactionLogEntryWrapper = { actionPendingReanalysis: false }; Object.assign(redactionLogEntryWrapper, changeLogEntry);