mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-08 20:25:26 +03:00
Cleanup
This commit is contained in:
parent
cb337877fe
commit
930981dc5c
@ -1,9 +1,8 @@
|
|||||||
import { baseUrl } from "./baseUrl";
|
import { baseUrl } from "./baseUrl";
|
||||||
import useSWR, { SWRConfig } from "swr";
|
import { 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/`;
|
||||||
|
|
||||||
@ -38,9 +37,7 @@ type WsWithConfigType = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function WsWithConfig({ children }: WsWithConfigType) {
|
function WsWithConfig({ children }: WsWithConfigType) {
|
||||||
const { data } = useSWR<FrigateConfig>("config");
|
return <WsProvider>{children}</WsProvider>;
|
||||||
|
|
||||||
return data ? <WsProvider config={data}>{children}</WsProvider> : children;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useApiHost() {
|
export function useApiHost() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user