Skip to content

Commit

Permalink
fix(front): Update currentPlan of Plans component so it is not always…
Browse files Browse the repository at this point in the history
… null (#480)
  • Loading branch information
maidi29 authored Sep 8, 2024
1 parent a778e64 commit 62f9d25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/front/src/fragments/Plans/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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();
}
Expand Down

0 comments on commit 62f9d25

Please sign in to comment.