mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-05 13:07:44 +03:00
Add change to CameraStreamingDialog
This commit is contained in:
parent
6c4d16921c
commit
1dd095c13d
@ -1,4 +1,5 @@
|
||||
import { useState, useCallback, useEffect, useMemo } from "react";
|
||||
import { useEnabledState } from "@/api/ws";
|
||||
import { IoIosWarning } from "react-icons/io";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
@ -63,6 +64,10 @@ export function CameraStreamingDialog({
|
||||
|
||||
// metadata
|
||||
|
||||
// camera enabled state
|
||||
const { payload: enabledState } = useEnabledState(camera);
|
||||
const cameraEnabled = enabledState === "ON";
|
||||
|
||||
const isRestreamed = useMemo(
|
||||
() =>
|
||||
config &&
|
||||
@ -71,7 +76,7 @@ export function CameraStreamingDialog({
|
||||
);
|
||||
|
||||
const { data: cameraMetadata } = useSWR<LiveStreamMetadata>(
|
||||
isRestreamed ? `go2rtc/streams/${streamName}` : null,
|
||||
cameraEnabled && isRestreamed ? `go2rtc/streams/${streamName}` : null,
|
||||
{
|
||||
revalidateOnFocus: false,
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user