fix RED-3757
This commit is contained in:
parent
99a904b48d
commit
fe2c880978
@ -68,7 +68,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
readonly canPerformAnnotationActions$: Observable<boolean>;
|
||||
readonly fileId = this.state.fileId;
|
||||
readonly dossierId = this.state.dossierId;
|
||||
readonly file$ = this.state.file$.pipe(tap(() => this._fileDataService.loadAnnotations()));
|
||||
readonly file$ = this.state.file$.pipe(tap(file => this._fileDataService.loadAnnotations(file)));
|
||||
ready = false;
|
||||
private _lastPage: string;
|
||||
|
||||
@ -390,7 +390,10 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
async annotationsChangedByReviewAction() {
|
||||
this.multiSelectService.deactivate();
|
||||
const file = await this.state.file;
|
||||
await firstValueFrom(this._filesService.reload(this.dossierId, file));
|
||||
const fileReloaded = await firstValueFrom(this._filesService.reload(this.dossierId, file));
|
||||
if (!fileReloaded) {
|
||||
await this._fileDataService.loadAnnotations(file);
|
||||
}
|
||||
}
|
||||
|
||||
closeFullScreen() {
|
||||
|
||||
@ -491,12 +491,8 @@ export class AnnotationActionsService {
|
||||
annotationsChanged: EventEmitter<AnnotationWrapper[]>,
|
||||
) {
|
||||
obs.subscribe({
|
||||
next: () => {
|
||||
annotationsChanged.emit(annotations);
|
||||
},
|
||||
error: () => {
|
||||
annotationsChanged.emit();
|
||||
},
|
||||
next: () => annotationsChanged.emit(annotations),
|
||||
error: () => annotationsChanged.emit(),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -95,9 +95,7 @@ export class FileDataService {
|
||||
);
|
||||
}
|
||||
|
||||
async loadAnnotations() {
|
||||
const file = await this._state.file;
|
||||
|
||||
async loadAnnotations(file: File) {
|
||||
if (!file || file.isUnprocessed) {
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user