Recordings Fixes (#13005)

* If recordings don't exist mark as no recordings

* Fix reloading recordings failing

* Fix mark items not clearing selected

* Cleanup

* Default to last full hour when error occurs

* Remove check

* Cleanup

* Handle empty recordings list case

* Ensure that the start time is within the time range

* Catch other reset cases
This commit is contained in:
Nicolas Mowen
2024-08-12 14:30:16 -06:00
parent b2c23a367d
commit dc04cf82d8
4 changed files with 36 additions and 7 deletions

View File

@@ -395,6 +395,7 @@ export default function EventView({
markAllItemsAsReviewed={markAllItemsAsReviewed}
onSelectReview={onSelectReview}
onSelectAllReviews={onSelectAllReviews}
setSelectedReviews={setSelectedReviews}
pullLatestData={pullLatestData}
/>
)}
@@ -437,6 +438,7 @@ type DetectionReviewProps = {
markAllItemsAsReviewed: (currentItems: ReviewSegment[]) => void;
onSelectReview: (review: ReviewSegment, ctrl: boolean) => void;
onSelectAllReviews: () => void;
setSelectedReviews: (reviewIds: string[]) => void;
pullLatestData: () => void;
};
function DetectionReview({
@@ -455,6 +457,7 @@ function DetectionReview({
markAllItemsAsReviewed,
onSelectReview,
onSelectAllReviews,
setSelectedReviews,
pullLatestData,
}: DetectionReviewProps) {
const reviewTimelineRef = useRef<HTMLDivElement>(null);
@@ -692,6 +695,7 @@ function DetectionReview({
className="text-white"
variant="select"
onClick={() => {
setSelectedReviews([]);
markAllItemsAsReviewed(currentItems ?? []);
}}
>