small fix plan-editor

This commit is contained in:
mchouliara 2024-09-24 10:41:38 +03:00
parent 88340e3580
commit 453cde406e
1 changed files with 10 additions and 7 deletions

View File

@ -210,14 +210,17 @@ export class PlanEditorComponent extends BaseEditor<PlanEditorModel, Plan> imple
super.ngOnInit(); super.ngOnInit();
if (this.isNew === false && this.step === 0) this.nextStep(); if (this.isNew === false && this.step === 0) this.nextStep();
this.formAnnotationService.init(this.item.id, AnnotationEntityType.Plan);
this.formAnnotationService.getAnnotationCountObservable().pipe(takeUntil(this._destroyed)).subscribe((annotationsPerAnchor: Map<string, number>) => {
this.annotationsPerAnchor = annotationsPerAnchor;
});
this.formAnnotationService.getOpenAnnotationSubjectObservable().pipe(takeUntil(this._destroyed)).subscribe((anchorId: string) => { if(this.item?.id){
if (anchorId && anchorId == this.item.id?.toString()) this.showAnnotations(anchorId); this.formAnnotationService.init(this.item.id, AnnotationEntityType.Plan);
}); this.formAnnotationService.getAnnotationCountObservable().pipe(takeUntil(this._destroyed)).subscribe((annotationsPerAnchor: Map<string, number>) => {
this.annotationsPerAnchor = annotationsPerAnchor;
});
this.formAnnotationService.getOpenAnnotationSubjectObservable().pipe(takeUntil(this._destroyed)).subscribe((anchorId: string) => {
if (anchorId && anchorId == this.item.id?.toString()) this.showAnnotations(anchorId);
});
}
} }
ngAfterViewInit(): void { ngAfterViewInit(): void {