Adjustments and fixes (#10346)

* Increase duration of alerts and detections

* Add key

* Fix cancel button

* Fix motion review when switching days

* Add reset buttons and make calendar apply immediately

* Adjust apis for motion and audio activity

* Write review thumbs as webp and reduce size
This commit is contained in:
Nicolas Mowen
2024-03-09 07:08:06 -07:00
committed by GitHub
parent eeb2187b97
commit 62d13024f6
7 changed files with 111 additions and 50 deletions

View File

@@ -260,6 +260,7 @@ export default function EventView({
)}
{severity == "significant_motion" && (
<MotionReview
key={timeRange.before}
contentRef={contentRef}
reviewItems={reviewItems}
relevantPreviews={relevantPreviews}
@@ -563,7 +564,7 @@ function MotionReview({
// motion data
const { data: motionData } = useSWR<MotionData[]>([
"review/activity",
"review/activity/motion",
{
before: timeRange.before,
after: timeRange.after,
@@ -598,7 +599,7 @@ function MotionReview({
const [selectedRangeIdx, setSelectedRangeIdx] = useState(initialIndex);
const [currentTime, setCurrentTime] = useState<number>(
startTime ?? timeRangeSegments.ranges[selectedRangeIdx].start,
startTime ?? timeRangeSegments.ranges[selectedRangeIdx]?.start,
);
const currentTimeRange = useMemo(
() => timeRangeSegments.ranges[selectedRangeIdx],