From 1f1b80a93e4e113f3a75b11c0586b93be4a08b98 Mon Sep 17 00:00:00 2001 From: domsteinbach <36757218+domsteinbach@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:55:08 +0100 Subject: [PATCH] fix: update annotations tab when switching to a compound without page (DEV-4171) (#1997) Co-authored-by: Irmantas Kaukas --- .../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); } }); }