RED-6506: Clean up code.

This commit is contained in:
Nicoleta Panaghiu 2023-04-03 15:52:04 +03:00
parent cd2f51c30e
commit 0b5e0d24f4

View File

@ -161,7 +161,6 @@ export class AnnotationActionsService {
AcceptRecommendationDialogComponent,
{ ...defaultDialogConfig, autoFocus: true, data: { annotations: recommendations, dossierId } },
);
// TODO: remove observables
const dialogClosed = dialogRef.afterClosed().pipe(filter(value => !!value && !!value.annotations));
await firstValueFrom(dialogClosed).then(({ annotations, comment: commentText }) => {
if (isJustOne(annotations) && this._annotationManager.resizingAnnotationId === annotations[0].id) {
@ -284,14 +283,9 @@ export class AnnotationActionsService {
}
async #processObsAndEmit(obs: Observable<unknown>) {
// TODO: remove observables and use promises instead
await firstValueFrom(obs)
.then(() => this._fileDataService.annotationsChanged())
.catch(() => this._fileDataService.annotationsChanged());
// obs.subscribe({
// next: () => this._fileDataService.annotationsChanged(),
// error: () => this._fileDataService.annotationsChanged(),
// });
}
private _getFalsePositiveText(annotation: AnnotationWrapper) {