mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-09 15:05:26 +03:00
don't use ternary operator when displaying motion previews
the main previews were being unnecessarily unmounted
This commit is contained in:
parent
6817108a95
commit
d1793207b4
@ -1284,7 +1284,7 @@ function MotionReview({
|
||||
|
||||
return (
|
||||
<>
|
||||
{motionPreviewsCamera && selectedMotionPreviewCamera ? (
|
||||
{selectedMotionPreviewCamera && (
|
||||
<>
|
||||
<div className="relative mb-2 flex h-11 items-center justify-between pl-2 pr-2 md:px-3">
|
||||
<Button
|
||||
@ -1465,10 +1465,15 @@ function MotionReview({
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
<div className="no-scrollbar flex min-w-0 flex-1 flex-wrap content-start gap-2 overflow-y-auto md:gap-4">
|
||||
)}
|
||||
<div
|
||||
ref={contentRef}
|
||||
className={cn(
|
||||
"no-scrollbar flex min-w-0 flex-1 flex-wrap content-start gap-2 overflow-y-auto md:gap-4",
|
||||
selectedMotionPreviewCamera && "hidden",
|
||||
)}
|
||||
>
|
||||
<div
|
||||
ref={selectedMotionPreviewCamera ? undefined : contentRef}
|
||||
className={cn(
|
||||
"no-scrollbar grid w-full grid-cols-1",
|
||||
isMobile && "landscape:grid-cols-2",
|
||||
@ -1562,7 +1567,6 @@ function MotionReview({
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{!selectedMotionPreviewCamera && (
|
||||
<div className="no-scrollbar w-[55px] overflow-y-auto md:w-[100px]">
|
||||
{motionData ? (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user