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 { WsProvider } from "./ws";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
|
import { FrigateConfig } from "@/types/frigateConfig";
|
||||||
|
|
||||||
axios.defaults.baseURL = `${baseUrl}api/`;
|
axios.defaults.baseURL = `${baseUrl}api/`;
|
||||||
|
|
||||||
@ -36,8 +37,6 @@ type WsWithConfigType = {
|
|||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
type FrigateConfig = Record<string, any>;
|
|
||||||
|
|
||||||
function WsWithConfig({ children }: WsWithConfigType) {
|
function WsWithConfig({ children }: WsWithConfigType) {
|
||||||
const { data } = useSWR<FrigateConfig>("config");
|
const { data } = useSWR<FrigateConfig>("config");
|
||||||
|
|
||||||
|
|||||||
@ -9,8 +9,7 @@ import {
|
|||||||
} from "react";
|
} from "react";
|
||||||
import { produce, Draft } from "immer";
|
import { produce, Draft } from "immer";
|
||||||
import useWebSocket, { ReadyState } from "react-use-websocket";
|
import useWebSocket, { ReadyState } from "react-use-websocket";
|
||||||
|
import { FrigateConfig } from "@/types/frigateConfig";
|
||||||
type FrigateConfig = Record<string, any>;
|
|
||||||
|
|
||||||
type ReducerState = {
|
type ReducerState = {
|
||||||
[topic: string]: {
|
[topic: string]: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user