From b7ba6f7c518499586c6c20f4f2fe5b9763f5401c Mon Sep 17 00:00:00 2001 From: JackTheRooster Date: Wed, 19 Feb 2025 22:26:47 -0600 Subject: [PATCH] moved UsbConfigState interface to stores --- ui/src/components/USBConfigDialog.tsx | 2 +- ui/src/components/sidebar/settings.tsx | 2 +- ui/src/hooks/stores.ts | 8 ++++++++ ui/src/utils.ts | 8 -------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ui/src/components/USBConfigDialog.tsx b/ui/src/components/USBConfigDialog.tsx index e521d4b..7b1c5a8 100644 --- a/ui/src/components/USBConfigDialog.tsx +++ b/ui/src/components/USBConfigDialog.tsx @@ -8,7 +8,7 @@ import { InputFieldWithLabel } from "./InputField"; import { useJsonRpc } from "@/hooks/useJsonRpc"; import { useUsbConfigModalStore } from "@/hooks/stores"; import ExtLink from "@components/ExtLink"; -import { UsbConfigState } from "@/utils" +import { UsbConfigState } from "@/hooks/stores" export default function USBConfigDialog({ open, diff --git a/ui/src/components/sidebar/settings.tsx b/ui/src/components/sidebar/settings.tsx index f4d2085..afd883e 100644 --- a/ui/src/components/sidebar/settings.tsx +++ b/ui/src/components/sidebar/settings.tsx @@ -26,7 +26,7 @@ import { LocalDevice } from "@routes/devices.$id"; import { useRevalidator } from "react-router-dom"; import { ShieldCheckIcon } from "@heroicons/react/20/solid"; import USBConfigDialog from "@components/USBConfigDialog"; -import { UsbConfigState } from "@/utils" +import { UsbConfigState } from "@/hooks/stores" export function SettingsItem({ title, diff --git a/ui/src/hooks/stores.ts b/ui/src/hooks/stores.ts index a6b4451..896bdbe 100644 --- a/ui/src/hooks/stores.ts +++ b/ui/src/hooks/stores.ts @@ -538,6 +538,14 @@ interface UsbConfigModalState { setErrorMessage: (message: string | null) => void; } +export interface UsbConfigState { + vendor_id: string; + product_id: string; + serial_number: string; + manufacturer: string; + product: string; +} + export const useUsbConfigModalStore = create(set => ({ modalView: "updateUsbConfig", errorMessage: null, diff --git a/ui/src/utils.ts b/ui/src/utils.ts index c9085d0..efd00fd 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -232,11 +232,3 @@ export function isChromeOS() { /* ChromeOS sets navigator.platform to Linux :/ */ return !!navigator.userAgent.match(" CrOS "); } - -export interface UsbConfigState { - vendor_id: string; - product_id: string; - serial_number: string; - manufacturer: string; - product: string; -} \ No newline at end of file