Skip to content

Commit

Permalink
Fix previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
juliansebline committed Jun 18, 2022
1 parent 7dd44c1 commit 556f5ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/instruments/src/RMP/Components/NavRadioPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export const NavRadioPanel = (props: Props) => {
}

const [mode, setMode] = useState(Mode.FREQUENCY);
const [currentTransceiver, setCurrentTransceiver] = useState(props.transceiver);

const [activeFrequency, setActiveFrequencySaved] = useActiveFrequency(props.transceiver, props.side);
const [standbyFrequency, setStandbyFrequencySaved] = useStandbyFrequency(props.transceiver, props.side);
Expand All @@ -125,6 +126,11 @@ export const NavRadioPanel = (props: Props) => {
}
});

if (currentTransceiver !== props.transceiver) {
setMode(Mode.FREQUENCY);
setCurrentTransceiver(props.transceiver);
}

if (mode === Mode.FREQUENCY) {
standbyWindow = <StandbyFrequency side={props.side} value={standbyFrequency} setValue={setStandbyFrequencySaved} transceiver={props.transceiver} />;
} else {
Expand Down

0 comments on commit 556f5ac

Please sign in to comment.