fix: bugs using real hardware
This commit is contained in:
@@ -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 = () => {
|
||||
|
||||
Reference in New Issue
Block a user