From b4d3ea3012a3925271a204735e062a26ed43ec84 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 7 Dec 2023 21:25:27 -0600 Subject: [PATCH] use frigateConfig type in websocket handlers --- web-new/src/api/index.tsx | 3 +-- web-new/src/api/ws.tsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/web-new/src/api/index.tsx b/web-new/src/api/index.tsx index b2aa97a08..1f59ed71c 100644 --- a/web-new/src/api/index.tsx +++ b/web-new/src/api/index.tsx @@ -3,6 +3,7 @@ import useSWR, { SWRConfig } from "swr"; import { WsProvider } from "./ws"; import axios from "axios"; import { ReactNode } from "react"; +import { FrigateConfig } from "@/types/frigateConfig"; axios.defaults.baseURL = `${baseUrl}api/`; @@ -36,8 +37,6 @@ type WsWithConfigType = { children: ReactNode; }; -type FrigateConfig = Record; - function WsWithConfig({ children }: WsWithConfigType) { const { data } = useSWR("config"); diff --git a/web-new/src/api/ws.tsx b/web-new/src/api/ws.tsx index d9eb063f4..3f1cd87e6 100644 --- a/web-new/src/api/ws.tsx +++ b/web-new/src/api/ws.tsx @@ -9,8 +9,7 @@ import { } from "react"; import { produce, Draft } from "immer"; import useWebSocket, { ReadyState } from "react-use-websocket"; - -type FrigateConfig = Record; +import { FrigateConfig } from "@/types/frigateConfig"; type ReducerState = { [topic: string]: {