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) {
|
||||
recStore.playedItem = undefined;
|
||||
}
|
||||
}, [openedValue, recStore]);
|
||||
}, [openedValue, recStore.playedItem]);
|
||||
|
||||
const dayItems = useMemo(() => {
|
||||
if (recordSummary && recordSummary.hours.length > 0 && hostName && host) {
|
||||
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 (
|
||||
<DayAccordionItemMemo
|
||||
camera={camera}
|
||||
|
||||
@ -41,7 +41,7 @@ const DayAccordionItem = ({
|
||||
|
||||
const hour = recordHour.hour
|
||||
const day = recordSummary.day
|
||||
const item = day + hour
|
||||
const item = hostName + cameraName + day + hour
|
||||
const recordURL = proxyApi.recordingURL(
|
||||
hostName,
|
||||
cameraName,
|
||||
|
||||
@ -37,7 +37,7 @@ const DayPanel = ({
|
||||
<Accordion.Panel key={hour + 'Panel'}>
|
||||
{playedURL && playedURL === videoURL ? <VideoPlayer videoUrl={playedURL} /> : <></>}
|
||||
{cameraName && hostName ?
|
||||
<Flex w='100%' justify='center' mb='0.5rem'>
|
||||
<Flex w='100%' justify='center' mb='0.5rem' mt='1rem'>
|
||||
<VideoDownloader
|
||||
cameraName={cameraName}
|
||||
hostName={hostName}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user