diff --git a/fbw-a380x/src/systems/instruments/src/MFD/FMC/FlightManagementComputer.ts b/fbw-a380x/src/systems/instruments/src/MFD/FMC/FlightManagementComputer.ts index fdb2f6876d3..92096f26a14 100644 --- a/fbw-a380x/src/systems/instruments/src/MFD/FMC/FlightManagementComputer.ts +++ b/fbw-a380x/src/systems/instruments/src/MFD/FMC/FlightManagementComputer.ts @@ -151,8 +151,17 @@ export class FlightManagementComputer implements FmcInterface { // TODO remove this cyclic dependency, isWaypointInUse should be moved to DataInterface private dataManager: DataManager | null = null; - private readonly flightPhase = ConsumerSubject.create(null, this.flightPhaseManager.phase); - private readonly activePage = ConsumerSubject.create(null, null); + private readonly sub = this.bus.getSubscriber(); + + private readonly flightPhase = ConsumerSubject.create( + this.sub.on('fmgc_flight_phase'), + this.flightPhaseManager.phase, + ); + private readonly activePage = ConsumerSubject.create( + this.sub.on('mfd_active_uri'), + null, + ); + private readonly isReset = Subject.create(true); private readonly shouldBePreflightPhase = MappedSubject.create( @@ -245,10 +254,6 @@ export class FlightManagementComputer implements FmcInterface { this.flightPhaseManager.addOnPhaseChanged((prev, next) => this.onFlightPhaseChanged(prev, next)); - const sub = this.bus.getSubscriber(); - this.flightPhase.setConsumer(sub.on('fmgc_flight_phase')); - this.activePage.setConsumer(sub.on('mfd_active_uri')); - this.shouldBePreflightPhase.sub((shouldBePreflight) => { if (shouldBePreflight) { this.flightPhaseManager.changePhase(FmgcFlightPhase.Preflight);