RED-6412, remove unused imports, add trackby to stop flickering.

This commit is contained in:
George 2023-03-30 16:53:19 +03:00
parent fdae158755
commit a99810fea3
3 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,5 @@
import { Component, HostBinding, Input, OnChanges } from '@angular/core';
import { AnnotationWrapper } from '@models/file/annotation.wrapper';
import { MultiSelectService } from '../../services/multi-select.service';
import { AnnotationsListingService } from '../../services/annotations-listing.service';
import { PdfProxyService } from '../../services/pdf-proxy.service';
import { ScrollableParentViews } from '@iqser/common-ui';

View File

@ -1,4 +1,4 @@
<ng-container *ngFor="let annotation of annotations; let idx = index">
<ng-container *ngFor="let annotation of annotations; let idx = index; trackBy: _trackBy">
<div *ngIf="showHighlightGroup(idx) as highlightGroup" class="workload-separator">
<redaction-highlights-separator [annotation]="annotation.item" [highlightGroup]="highlightGroup"></redaction-highlights-separator>
</div>

View File

@ -22,6 +22,7 @@ export class AnnotationsListComponent extends HasScrollbarDirective implements O
@Output() readonly pagesPanelActive = new EventEmitter<boolean>();
readonly earmarkGroups$ = new BehaviorSubject<EarmarkGroup[]>([]);
protected readonly _trackBy = (index: number, listItem: ListItem<AnnotationWrapper>) => listItem.item.id;
constructor(
protected readonly _elementRef: ElementRef,