mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix alert thumbnails on iOS and safari desktop (#14121)
This commit is contained in:
parent
75d531285a
commit
a1efcfb2d0
@ -17,6 +17,7 @@ import { usePersistence } from "@/hooks/use-persistence";
|
|||||||
import { Skeleton } from "../ui/skeleton";
|
import { Skeleton } from "../ui/skeleton";
|
||||||
import { Button } from "../ui/button";
|
import { Button } from "../ui/button";
|
||||||
import { FaCircleCheck } from "react-icons/fa6";
|
import { FaCircleCheck } from "react-icons/fa6";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
type AnimatedEventCardProps = {
|
type AnimatedEventCardProps = {
|
||||||
event: ReviewSegment;
|
event: ReviewSegment;
|
||||||
@ -145,7 +146,10 @@ export function AnimatedEventCard({
|
|||||||
>
|
>
|
||||||
{!alertVideos ? (
|
{!alertVideos ? (
|
||||||
<img
|
<img
|
||||||
className="max-h-full select-none"
|
className={cn(
|
||||||
|
"h-full w-auto min-w-10 select-none object-contain",
|
||||||
|
isSafari && !isLoaded ? "hidden" : "visible",
|
||||||
|
)}
|
||||||
src={`${apiHost}${event.thumb_path.replace("/media/frigate/", "")}`}
|
src={`${apiHost}${event.thumb_path.replace("/media/frigate/", "")}`}
|
||||||
loading={isSafari ? "eager" : "lazy"}
|
loading={isSafari ? "eager" : "lazy"}
|
||||||
onLoad={() => setIsLoaded(true)}
|
onLoad={() => setIsLoaded(true)}
|
||||||
@ -200,7 +204,14 @@ export function AnimatedEventCard({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{!isLoaded && <Skeleton className="absolute inset-0" />}
|
{!isLoaded && (
|
||||||
|
<Skeleton
|
||||||
|
style={{
|
||||||
|
aspectRatio: alertVideos ? aspectRatio : 16 / 9,
|
||||||
|
}}
|
||||||
|
className="size-full"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent>
|
<TooltipContent>
|
||||||
|
Loading…
Reference in New Issue
Block a user