mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-12 16:16:42 +03:00
restream tweak
This commit is contained in:
parent
c01db9a1d2
commit
4f33f4f664
@ -190,18 +190,18 @@ export default function Step2StreamConfig({
|
|||||||
[updateStream, t],
|
[updateStream, t],
|
||||||
);
|
);
|
||||||
|
|
||||||
const setLiveViewStream = useCallback(
|
const setRestream = useCallback(
|
||||||
(streamId: string) => {
|
(streamId: string) => {
|
||||||
const currentIds = wizardData.liveViewStreamIds || [];
|
const currentIds = wizardData.restreamIds || [];
|
||||||
const isSelected = currentIds.includes(streamId);
|
const isSelected = currentIds.includes(streamId);
|
||||||
const newIds = isSelected
|
const newIds = isSelected
|
||||||
? currentIds.filter((id) => id !== streamId)
|
? currentIds.filter((id) => id !== streamId)
|
||||||
: [...currentIds, streamId];
|
: [...currentIds, streamId];
|
||||||
onUpdate({
|
onUpdate({
|
||||||
liveViewStreamIds: newIds,
|
restreamIds: newIds,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[wizardData.liveViewStreamIds, onUpdate],
|
[wizardData.restreamIds, onUpdate],
|
||||||
);
|
);
|
||||||
|
|
||||||
const hasDetectRole = streams.some((s) => s.roles.includes("detect"));
|
const hasDetectRole = streams.some((s) => s.roles.includes("detect"));
|
||||||
@ -348,10 +348,10 @@ export default function Step2StreamConfig({
|
|||||||
{t("cameraWizard.step2.go2rtc")}
|
{t("cameraWizard.step2.go2rtc")}
|
||||||
</span>
|
</span>
|
||||||
<Switch
|
<Switch
|
||||||
checked={(wizardData.liveViewStreamIds || []).includes(
|
checked={(wizardData.restreamIds || []).includes(
|
||||||
stream.id,
|
stream.id,
|
||||||
)}
|
)}
|
||||||
onCheckedChange={() => setLiveViewStream(stream.id)}
|
onCheckedChange={() => setRestream(stream.id)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user