mirror of https://github.com/jetkvm/kvm.git
cleaned up settings file
This commit is contained in:
parent
afebc2dd1e
commit
c6ba93c46f
|
@ -103,6 +103,12 @@ export default function SettingsSidebar() {
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
|
|
||||||
const [usbEmulationEnabled, setUsbEmulationEnabled] = useState(false);
|
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({
|
const [usbConfig, setUsbConfig] = useState({
|
||||||
usb_product_id: '',
|
usb_product_id: '',
|
||||||
|
@ -112,13 +118,6 @@ export default function SettingsSidebar() {
|
||||||
usb_name: '',
|
usb_name: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
const getUsbEmulationState = useCallback(() => {
|
|
||||||
send("getUsbEmulationState", {}, resp => {
|
|
||||||
if ("error" in resp) return;
|
|
||||||
setUsbEmulationEnabled(resp.result as boolean);
|
|
||||||
});
|
|
||||||
}, [send]);
|
|
||||||
|
|
||||||
const handleUsbEmulationToggle = useCallback(
|
const handleUsbEmulationToggle = useCallback(
|
||||||
(enabled: boolean) => {
|
(enabled: boolean) => {
|
||||||
send("setUsbEmulationState", { enabled: enabled }, resp => {
|
send("setUsbEmulationState", { enabled: enabled }, resp => {
|
||||||
|
|
Loading…
Reference in New Issue