fix accordion play status when selected host and changed camera
This commit is contained in:
parent
9472c5224c
commit
d25d26b8ae
@ -33,12 +33,13 @@ const DayAccordion = ({
|
|||||||
} else if (openedValue === value && recStore.playedItem === value) {
|
} else if (openedValue === value && recStore.playedItem === value) {
|
||||||
recStore.playedItem = undefined;
|
recStore.playedItem = undefined;
|
||||||
}
|
}
|
||||||
}, [openedValue, recStore]);
|
}, [openedValue, recStore.playedItem]);
|
||||||
|
|
||||||
const dayItems = useMemo(() => {
|
const dayItems = useMemo(() => {
|
||||||
if (recordSummary && recordSummary.hours.length > 0 && hostName && host) {
|
if (recordSummary && recordSummary.hours.length > 0 && hostName && host) {
|
||||||
return recordSummary.hours.map(hour => {
|
return recordSummary.hours.map(hour => {
|
||||||
const played = recordSummary.day + hour.hour === recStore.playedItem;
|
const item = hostName + camera.name + recordSummary.day + hour.hour
|
||||||
|
const played = item === recStore.playedItem;
|
||||||
return (
|
return (
|
||||||
<DayAccordionItemMemo
|
<DayAccordionItemMemo
|
||||||
camera={camera}
|
camera={camera}
|
||||||
|
|||||||
@ -41,7 +41,7 @@ const DayAccordionItem = ({
|
|||||||
|
|
||||||
const hour = recordHour.hour
|
const hour = recordHour.hour
|
||||||
const day = recordSummary.day
|
const day = recordSummary.day
|
||||||
const item = day + hour
|
const item = hostName + cameraName + day + hour
|
||||||
const recordURL = proxyApi.recordingURL(
|
const recordURL = proxyApi.recordingURL(
|
||||||
hostName,
|
hostName,
|
||||||
cameraName,
|
cameraName,
|
||||||
|
|||||||
@ -37,7 +37,7 @@ const DayPanel = ({
|
|||||||
<Accordion.Panel key={hour + 'Panel'}>
|
<Accordion.Panel key={hour + 'Panel'}>
|
||||||
{playedURL && playedURL === videoURL ? <VideoPlayer videoUrl={playedURL} /> : <></>}
|
{playedURL && playedURL === videoURL ? <VideoPlayer videoUrl={playedURL} /> : <></>}
|
||||||
{cameraName && hostName ?
|
{cameraName && hostName ?
|
||||||
<Flex w='100%' justify='center' mb='0.5rem'>
|
<Flex w='100%' justify='center' mb='0.5rem' mt='1rem'>
|
||||||
<VideoDownloader
|
<VideoDownloader
|
||||||
cameraName={cameraName}
|
cameraName={cameraName}
|
||||||
hostName={hostName}
|
hostName={hostName}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user