mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-09 04:35:25 +03:00
Don't show minimap when minimap bounds exceed timeline area
This commit is contained in:
parent
ca85c317e8
commit
ab9c2004e0
@ -384,11 +384,8 @@ function DetectionReview({
|
|||||||
[timeRange],
|
[timeRange],
|
||||||
);
|
);
|
||||||
|
|
||||||
const { alignStartDateToTimeline } = useTimelineUtils(
|
const { alignStartDateToTimeline, getVisibleTimelineDuration } =
|
||||||
segmentDuration,
|
useTimelineUtils(segmentDuration, timelineDuration, reviewTimelineRef);
|
||||||
timelineDuration,
|
|
||||||
reviewTimelineRef,
|
|
||||||
);
|
|
||||||
|
|
||||||
const scrollLock = useScrollLockout(contentRef);
|
const scrollLock = useScrollLockout(contentRef);
|
||||||
|
|
||||||
@ -457,10 +454,21 @@ function DetectionReview({
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return contentRef.current.scrollHeight > contentRef.current.clientHeight;
|
// don't show minimap if the view is not scrollable
|
||||||
|
if (contentRef.current.scrollHeight < contentRef.current.clientHeight) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const visibleTime = getVisibleTimelineDuration();
|
||||||
|
const minimapTime = minimapBounds.end - minimapBounds.start;
|
||||||
|
if (visibleTime && minimapTime >= visibleTime * 0.75) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
// we know that these deps are correct
|
// we know that these deps are correct
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [contentRef.current?.scrollHeight, severity]);
|
}, [contentRef.current?.scrollHeight, minimapBounds]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user