From b54d6f89a5361c10cb2f4bb1021956a56e78ba2a Mon Sep 17 00:00:00 2001 From: Maidi Date: Tue, 20 Aug 2024 14:29:11 +0200 Subject: [PATCH] fix(front): Update currentPlan of Plans component so it is not always null --- packages/front/src/fragments/Plans/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/front/src/fragments/Plans/index.ts b/packages/front/src/fragments/Plans/index.ts index b4624b14e..d3480e9fa 100644 --- a/packages/front/src/fragments/Plans/index.ts +++ b/packages/front/src/fragments/Plans/index.ts @@ -179,6 +179,10 @@ export class Plans extends OBC.Component implements OBC.Disposable { const sections = this.components.get(Sections); await sections.goTo(id, animate); await this.applyCachedPlanCamera(); + const foundPlan = this.list.find((plan) => plan.id === id); + if (foundPlan) { + this.currentPlan = foundPlan; + } this.enabled = true; } @@ -195,6 +199,7 @@ export class Plans extends OBC.Component implements OBC.Disposable { this.cachePlanCamera(); const sections = this.components.get(Sections); await sections.exit(animate); + this.currentPlan = null; this.enabled = false; this.onExited.trigger(); }