mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 11:45:24 +03:00
use frigateConfig type in websocket handlers
This commit is contained in:
parent
77a0eb41be
commit
b4d3ea3012
@ -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<string, any>;
|
||||
|
||||
function WsWithConfig({ children }: WsWithConfigType) {
|
||||
const { data } = useSWR<FrigateConfig>("config");
|
||||
|
||||
|
||||
@ -9,8 +9,7 @@ import {
|
||||
} from "react";
|
||||
import { produce, Draft } from "immer";
|
||||
import useWebSocket, { ReadyState } from "react-use-websocket";
|
||||
|
||||
type FrigateConfig = Record<string, any>;
|
||||
import { FrigateConfig } from "@/types/frigateConfig";
|
||||
|
||||
type ReducerState = {
|
||||
[topic: string]: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user