diff --git a/fbw-a380x/src/systems/instruments/src/OIT/OIT.tsx b/fbw-a380x/src/systems/instruments/src/OIT/OIT.tsx index ebcc10c5166..d447683c5d0 100644 --- a/fbw-a380x/src/systems/instruments/src/OIT/OIT.tsx +++ b/fbw-a380x/src/systems/instruments/src/OIT/OIT.tsx @@ -57,7 +57,7 @@ export class OIT extends DisplayComponent { return this.props.laptop.data; } - private readonly operationMode = Subject.create('flt-ops'); + public readonly operationMode = Subject.create('flt-ops'); public readonly hEventConsumer = this.props.bus.getSubscriber().on('kbdKeyEvent'); diff --git a/fbw-a380x/src/systems/instruments/src/OIT/OitHeader.tsx b/fbw-a380x/src/systems/instruments/src/OIT/OitHeader.tsx index 7f8ded8c33f..5e8cb806d09 100644 --- a/fbw-a380x/src/systems/instruments/src/OIT/OitHeader.tsx +++ b/fbw-a380x/src/systems/instruments/src/OIT/OitHeader.tsx @@ -83,8 +83,22 @@ export abstract class OitHeader extends DisplayComponent { isActive={SubscribableUtils.toSubscribable(false, true)} label="FUNCTIONS" menuItems={[ - { label: 'HOME', action: () => {}, disabled: true }, - { label: 'PREVIOUS', action: () => {}, disabled: true }, + { + label: 'HOME', + action: () => { + if (this.props.oit.operationMode.get() === 'flt-ops') { + this.props.uiService.navigateTo('flt-ops'); + } + }, + }, + { + label: 'PREVIOUS', + action: () => { + if (this.props.uiService.canGoBack()) { + this.props.uiService.navigateTo('back'); + } + }, + }, { label: 'NEXT', action: () => {}, disabled: true, separatorBelow: true }, { label: 'PRINT', action: () => {}, disabled: true }, { label: 'STORE', action: () => {}, disabled: true }, diff --git a/fbw-a380x/src/systems/instruments/src/OITlegacy/OitLegacy.tsx b/fbw-a380x/src/systems/instruments/src/OITlegacy/OitLegacy.tsx index 5d4f0c71229..24177e356e2 100644 --- a/fbw-a380x/src/systems/instruments/src/OITlegacy/OitLegacy.tsx +++ b/fbw-a380x/src/systems/instruments/src/OITlegacy/OitLegacy.tsx @@ -16,7 +16,6 @@ import { setAirframeInfo, setCabinInfo, setFlypadInfo, - SimbriefData, store, TroubleshootingContextProvider, useAppDispatch, @@ -165,7 +164,6 @@ export const OitEfbPageWrapper: React.FC = () => { const [showOfp] = useSimVar(`L:A32NX_OIS_${getDisplayIndex()}_SHOW_OFP`, 'Bool', 100); const [synchroAvionics] = useSimVar('L:A32NX_OIS_SYNCHRO_AVIONICS', 'number', 100); - const [simBriefData, setSimBriefData] = useState(); const [fromAirport, setFromAirport] = useState(''); const [toAirport, setToAirport] = useState(''); const [altnAirport, setAltnAirport] = useState(''); @@ -184,14 +182,18 @@ export const OitEfbPageWrapper: React.FC = () => { (navigraphAuthInfo.loggedIn && navigraphAuthInfo.username) || '', overrideSimBriefUserID ?? '', ); - setSimBriefData(action.payload); - const newAction = simbriefDataFromFms(simBriefData, fromAirport, toAirport, altnAirport); + const newAction = simbriefDataFromFms(action.payload, fromAirport, toAirport, altnAirport); dispatch(newAction); } catch (e) { console.error(e.message); } }; + useEffect(() => { + console.log('navigraphAuthInfo.loggedIn, synchroAvionics', navigraphAuthInfo); + updateSimBriefInfo(); + }, [navigraphAuthInfo, synchroAvionics]); + useEffect(() => { const sub = bus.getSubscriber(); const subs: Subscription[] = []; @@ -230,10 +232,6 @@ export const OitEfbPageWrapper: React.FC = () => { }, [fromAirport, toAirport, altnAirport]); */ - useEffect(() => { - updateSimBriefInfo(); - }, [navigraphAuthInfo.loggedIn, synchroAvionics]); - return ( <> {showEfbOverlay && (