Config Page: Device Tab. threshold component. fix problem that the input component focused out when input something each time. Set threshold data when started python.
14 lines
567 B
JavaScript
14 lines
567 B
JavaScript
import { useMicDeviceList as useStoreMicDeviceList } from "@store";
|
|
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
|
|
|
export const useMicDeviceList = () => {
|
|
const { asyncStdoutToPython } = useStdoutToPython();
|
|
const { currentMicDeviceList, updateMicDeviceList } = useStoreMicDeviceList();
|
|
|
|
const getMicDeviceList = () => {
|
|
updateMicDeviceList(() => new Promise(() => {}));
|
|
asyncStdoutToPython("/controller/list_mic_device");
|
|
};
|
|
|
|
return { currentMicDeviceList, getMicDeviceList, updateMicDeviceList };
|
|
}; |