fixes and changes (#10587)

This commit is contained in:
Josh Hawkins
2024-03-21 09:00:04 -05:00
committed by GitHub
parent 865c26ff18
commit 4040191101
10 changed files with 156 additions and 114 deletions

View File

@@ -11,6 +11,7 @@ import MotionSegment from "./MotionSegment";
import { useTimelineUtils } from "@/hooks/use-timeline-utils";
import { MotionData, ReviewSegment, ReviewSeverity } from "@/types/review";
import ReviewTimeline from "./ReviewTimeline";
import { isDesktop } from "react-device-detect";
export type MotionReviewTimelineProps = {
segmentDuration: number;
@@ -218,7 +219,7 @@ export function MotionReviewTimeline({
const segmentsObserver = useRef<IntersectionObserver | null>(null);
const selectedTimelineRef = timelineRef || internalTimelineRef;
useEffect(() => {
if (selectedTimelineRef.current && segments) {
if (selectedTimelineRef.current && segments && isDesktop) {
segmentsObserver.current = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {