mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-11 17:47:37 +03:00
fix current zoom level handling
This commit is contained in:
parent
3d1bfc1fa2
commit
d9f62548de
@ -197,6 +197,14 @@ function UIPlayground() {
|
|||||||
[possibleZoomLevels],
|
[possibleZoomLevels],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const currentZoomLevel = useMemo(
|
||||||
|
() =>
|
||||||
|
possibleZoomLevels.findIndex(
|
||||||
|
(level) => level.segmentDuration === zoomSettings.segmentDuration,
|
||||||
|
),
|
||||||
|
[possibleZoomLevels, zoomSettings.segmentDuration],
|
||||||
|
);
|
||||||
|
|
||||||
const { zoomLevel, handleZoom, isZooming, zoomDirection } = useTimelineZoom({
|
const { zoomLevel, handleZoom, isZooming, zoomDirection } = useTimelineZoom({
|
||||||
zoomSettings,
|
zoomSettings,
|
||||||
zoomLevels: possibleZoomLevels,
|
zoomLevels: possibleZoomLevels,
|
||||||
@ -417,6 +425,7 @@ function UIPlayground() {
|
|||||||
zoomDirection={zoomDirection} // is the timeline zooming in or out
|
zoomDirection={zoomDirection} // is the timeline zooming in or out
|
||||||
onZoomChange={handleZoomChange}
|
onZoomChange={handleZoomChange}
|
||||||
possibleZoomLevels={possibleZoomLevels}
|
possibleZoomLevels={possibleZoomLevels}
|
||||||
|
currentZoomLevel={currentZoomLevel}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{isEventsReviewTimeline && (
|
{isEventsReviewTimeline && (
|
||||||
@ -446,6 +455,7 @@ function UIPlayground() {
|
|||||||
zoomDirection={zoomDirection} // is the timeline zooming in or out
|
zoomDirection={zoomDirection} // is the timeline zooming in or out
|
||||||
onZoomChange={handleZoomChange}
|
onZoomChange={handleZoomChange}
|
||||||
possibleZoomLevels={possibleZoomLevels}
|
possibleZoomLevels={possibleZoomLevels}
|
||||||
|
currentZoomLevel={currentZoomLevel}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -518,6 +518,14 @@ function DetectionReview({
|
|||||||
[possibleZoomLevels],
|
[possibleZoomLevels],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const currentZoomLevel = useMemo(
|
||||||
|
() =>
|
||||||
|
possibleZoomLevels.findIndex(
|
||||||
|
(level) => level.segmentDuration === zoomSettings.segmentDuration,
|
||||||
|
),
|
||||||
|
[possibleZoomLevels, zoomSettings.segmentDuration],
|
||||||
|
);
|
||||||
|
|
||||||
const { isZooming, zoomDirection } = useTimelineZoom({
|
const { isZooming, zoomDirection } = useTimelineZoom({
|
||||||
zoomSettings,
|
zoomSettings,
|
||||||
zoomLevels: possibleZoomLevels,
|
zoomLevels: possibleZoomLevels,
|
||||||
@ -824,6 +832,7 @@ function DetectionReview({
|
|||||||
zoomDirection={zoomDirection}
|
zoomDirection={zoomDirection}
|
||||||
onZoomChange={handleZoomChange}
|
onZoomChange={handleZoomChange}
|
||||||
possibleZoomLevels={possibleZoomLevels}
|
possibleZoomLevels={possibleZoomLevels}
|
||||||
|
currentZoomLevel={currentZoomLevel}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -901,6 +901,14 @@ function Timeline({
|
|||||||
[possibleZoomLevels],
|
[possibleZoomLevels],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const currentZoomLevel = useMemo(
|
||||||
|
() =>
|
||||||
|
possibleZoomLevels.findIndex(
|
||||||
|
(level) => level.segmentDuration === zoomSettings.segmentDuration,
|
||||||
|
),
|
||||||
|
[possibleZoomLevels, zoomSettings.segmentDuration],
|
||||||
|
);
|
||||||
|
|
||||||
const { isZooming, zoomDirection } = useTimelineZoom({
|
const { isZooming, zoomDirection } = useTimelineZoom({
|
||||||
zoomSettings,
|
zoomSettings,
|
||||||
zoomLevels: possibleZoomLevels,
|
zoomLevels: possibleZoomLevels,
|
||||||
@ -1013,6 +1021,7 @@ function Timeline({
|
|||||||
zoomDirection={zoomDirection}
|
zoomDirection={zoomDirection}
|
||||||
onZoomChange={handleZoomChange}
|
onZoomChange={handleZoomChange}
|
||||||
possibleZoomLevels={possibleZoomLevels}
|
possibleZoomLevels={possibleZoomLevels}
|
||||||
|
currentZoomLevel={currentZoomLevel}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Skeleton className="size-full" />
|
<Skeleton className="size-full" />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user