From 6bde35f272de698236068b2f480c7336cc5ba92c Mon Sep 17 00:00:00 2001 From: Luca Rossetto Date: Thu, 19 Oct 2023 15:33:20 +0200 Subject: [PATCH] Fixed viewer sending ready update repeatedly resolves remainder of #440 --- frontend/src/app/viewer/task-viewer.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/viewer/task-viewer.component.ts b/frontend/src/app/viewer/task-viewer.component.ts index 8786465e..39b2c874 100644 --- a/frontend/src/app/viewer/task-viewer.component.ts +++ b/frontend/src/app/viewer/task-viewer.component.ts @@ -125,7 +125,12 @@ export class TaskViewerComponent implements AfterViewInit, OnDestroy { } ), tap((hint) => { - this.state.pipe(switchMap(state => this.runService.getApiV2EvaluationByEvaluationIdByTaskIdReady(state.evaluationId, state.taskTemplateId))).subscribe() + this.state.pipe( + take(1), //use latest state, only do this once + switchMap( + state => this.runService.getApiV2EvaluationByEvaluationIdByTaskIdReady(state.evaluationId, state.taskTemplateId) + ) + ).subscribe() }) ).subscribe(n => this.currentTaskHint.next(n))