cleaned up settings file

This commit is contained in:
Adrian 2025-01-24 21:22:14 -06:00
parent afebc2dd1e
commit c6ba93c46f
1 changed files with 62 additions and 63 deletions

View File

@ -103,6 +103,12 @@ export default function SettingsSidebar() {
} | null>(null);
const [usbEmulationEnabled, setUsbEmulationEnabled] = useState(false);
const getUsbEmulationState = useCallback(() => {
send("getUsbEmulationState", {}, resp => {
if ("error" in resp) return;
setUsbEmulationEnabled(resp.result as boolean);
});
}, [send]);
const [usbConfig, setUsbConfig] = useState({
usb_product_id: '',
@ -112,13 +118,6 @@ export default function SettingsSidebar() {
usb_name: '',
})
const getUsbEmulationState = useCallback(() => {
send("getUsbEmulationState", {}, resp => {
if ("error" in resp) return;
setUsbEmulationEnabled(resp.result as boolean);
});
}, [send]);
const handleUsbEmulationToggle = useCallback(
(enabled: boolean) => {
send("setUsbEmulationState", { enabled: enabled }, resp => {