From 5abe0761452ac132fa8d19022a2dadc11972a435 Mon Sep 17 00:00:00 2001 From: domsteinbach Date: Tue, 10 Dec 2024 14:06:05 +0100 Subject: [PATCH] fix: update annotations tab when switching to a compound without incoming resource aka page --- .../resource-editor/src/lib/compound/compound.service.ts | 8 ++++---- .../resource-editor/src/lib/resource.component.ts | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/vre/resource-editor/resource-editor/src/lib/compound/compound.service.ts b/libs/vre/resource-editor/resource-editor/src/lib/compound/compound.service.ts index 9f65eac6f6..989739a5b4 100644 --- a/libs/vre/resource-editor/resource-editor/src/lib/compound/compound.service.ts +++ b/libs/vre/resource-editor/resource-editor/src/lib/compound/compound.service.ts @@ -16,8 +16,8 @@ import { BehaviorSubject } from 'rxjs'; export class CompoundService { compoundPosition!: DspCompoundPosition; - private _incomingResource = new BehaviorSubject(undefined); - incomingResource$ = this._incomingResource.asObservable(); + incomingResource = new BehaviorSubject(undefined); + incomingResource$ = this.incomingResource.asObservable(); private _resource!: DspResource; @@ -48,7 +48,7 @@ export class CompoundService { const incomingImageRepresentations = res as ReadResourceSequence; if (incomingImageRepresentations.resources.length === 0) { - this._incomingResource.next(undefined); + this.incomingResource.next(undefined); return; } this._resource.incomingRepresentations = incomingImageRepresentations.resources; @@ -75,7 +75,7 @@ export class CompoundService { } private _reloadViewer(resource: DspResource) { - this._incomingResource.next(resource); + this.incomingResource.next(resource); this._cd.detectChanges(); } } diff --git a/libs/vre/resource-editor/resource-editor/src/lib/resource.component.ts b/libs/vre/resource-editor/resource-editor/src/lib/resource.component.ts index b2681c000f..f7375d2112 100644 --- a/libs/vre/resource-editor/resource-editor/src/lib/resource.component.ts +++ b/libs/vre/resource-editor/resource-editor/src/lib/resource.component.ts @@ -87,6 +87,8 @@ export class ResourceComponent implements OnChanges { if (this.isCompoundNavigation) { this._compoundService.onInit(new DspCompoundPosition(countQuery_.numberOfResults), this.resource); this._cdr.detectChanges(); + } else { + this._compoundService.incomingResource.next(undefined); } }); }