Fix exports (#10824)

* Avoid crash from opening motion time right now

* Cleanup export margins

* Fix mobile filter

* Fix export

* Improve spacing
This commit is contained in:
Nicolas Mowen
2024-04-04 09:43:54 -06:00
committed by GitHub
parent fbc0da6016
commit 80e330594b
4 changed files with 13 additions and 12 deletions

View File

@@ -851,7 +851,7 @@ function MotionReview({
onClick={() =>
onOpenRecording({
camera: camera.name,
startTime: currentTime,
startTime: Math.min(currentTime, Date.now() / 1000 - 10),
severity: "significant_motion",
})
}

View File

@@ -142,7 +142,7 @@ export function RecordingView({
);
useEffect(() => {
if (scrubbing) {
if (scrubbing || exportRange) {
if (
currentTime > currentTimeRange.before + 60 ||
currentTime < currentTimeRange.after - 60
@@ -157,6 +157,8 @@ export function RecordingView({
controller.scrubToTimestamp(currentTime);
});
}
// we only want to seek when current time updates
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
currentTime,
scrubbing,
@@ -486,7 +488,9 @@ function Timeline({
setExportRange({ after: exportStart, before: exportEnd });
}
}, [exportRange, exportStart, exportEnd, setExportRange, setCurrentTime]);
// we only want to update when the export parts change
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [exportStart, exportEnd, setExportRange, setCurrentTime]);
return (
<div