fix: bugs using real hardware

This commit is contained in:
2026-10-04 21:01:09 +02:00
parent e28f61447f
commit e151ab4f26
3 changed files with 30 additions and 20 deletions
@@ -37,10 +37,8 @@ function MiscellaneousPanel({
const [isLinkModalOpen, setIsLinkModalOpen] = useState(false);
const [isCopyModalOpen, setIsCopyModalOpen] = useState(false);
const [inputSource, setInputSourceState] = useState<InputSource>({
type: InputType.Analog,
frequency: DiscreteFrequency.F20,
});
const [liveInputSource, setLiveInputSource] = useState<InputSource | null>(null);
const inputSource = liveInputSource ?? dsp.state.current_config.input_source;
const [password, setPassword] = useState('');
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
@@ -51,18 +49,19 @@ function MiscellaneousPanel({
frequency: type === InputType.SineWave ? inputSource.frequency : DiscreteFrequency.F20,
};
setInputSourceState(nextSource);
await setInputSource(nextSource);
setLiveInputSource(nextSource);
const success = await setInputSource(nextSource);
if (success) setLiveInputSource(null);
};
const handleFrequencyChange = async (frequency: DiscreteFrequency) => {
const nextSource: InputSource = {
...inputSource,
frequency,
};
const nextSource: InputSource = { ...inputSource, frequency };
setInputSourceState(nextSource);
await setInputSource(nextSource);
setLiveInputSource(nextSource);
const success = await setInputSource(nextSource);
if (success) setLiveInputSource(null);
};
const handleFactoryReset = () => {