Skip to content

Commit

Permalink
Added stopping aircraft when leaving pushback page
Browse files Browse the repository at this point in the history
  • Loading branch information
frankkopp committed Dec 9, 2022
1 parent 73b2135 commit 1193d87
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/instruments/src/EFB/Ground/Pages/PushbackPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const PushbackPage = () => {
bodyText={`${t('Pushback.DisableSystemMessageBody')}`}
onConfirm={() => {
releaseTug();
setPushbackSystemEnabled(0);
}}
/>,
);
Expand Down Expand Up @@ -130,10 +131,6 @@ export const PushbackPage = () => {
};

const handlePause = () => {
if (!pushbackPaused) {
setCmdHdgFactor(0);
setCmdSpdFactor(0);
}
setPushbackPaused(!pushbackPaused);
};

Expand Down Expand Up @@ -170,11 +167,21 @@ export const PushbackPage = () => {
hideProgressBar: true,
closeButton: false,
});
setCmdHdgFactor(0);
setCmdSpdFactor(0);
setPushbackPaused(() => true);
}
});
}, []);

// called when the pushback paused state changes
useEffect(() => {
if (pushbackPaused) {
setCmdHdgFactor(0);
setCmdSpdFactor(0);
}
}, [pushbackPaused]);

// Update commanded heading from rudder input
useEffect(() => {
if (!pushbackActive || !useControllerInput) {
Expand Down

0 comments on commit 1193d87

Please sign in to comment.