mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-09 15:05:26 +03:00
Merge 4123acda00 into 2cfb530dbf
This commit is contained in:
commit
0880937993
@ -5,6 +5,7 @@ import { LiveStreamMetadata } from "@/types/live";
|
|||||||
|
|
||||||
const FETCH_TIMEOUT_MS = 10000;
|
const FETCH_TIMEOUT_MS = 10000;
|
||||||
const DEFER_DELAY_MS = 2000;
|
const DEFER_DELAY_MS = 2000;
|
||||||
|
const EMPTY_METADATA: { [key: string]: LiveStreamMetadata } = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook that fetches go2rtc stream metadata with deferred loading.
|
* Hook that fetches go2rtc stream metadata with deferred loading.
|
||||||
@ -77,7 +78,7 @@ export default function useDeferredStreamMetadata(streamNames: string[]) {
|
|||||||
return metadata;
|
return metadata;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const { data: metadata = {} } = useSWR<{
|
const { data: metadata = EMPTY_METADATA } = useSWR<{
|
||||||
[key: string]: LiveStreamMetadata;
|
[key: string]: LiveStreamMetadata;
|
||||||
}>(swrKey, fetcher, {
|
}>(swrKey, fetcher, {
|
||||||
revalidateOnFocus: false,
|
revalidateOnFocus: false,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user