forked from Github/frigate
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:
@@ -101,7 +101,7 @@ export default function Events() {
|
||||
|
||||
// review paging
|
||||
|
||||
const [beforeTs, setBeforeTs] = useState(Date.now() / 1000);
|
||||
const [beforeTs, setBeforeTs] = useState(Math.ceil(Date.now() / 1000));
|
||||
const last24Hours = useMemo(() => {
|
||||
return { before: beforeTs, after: getHoursAgo(24) };
|
||||
}, [beforeTs]);
|
||||
@@ -455,5 +455,5 @@ export default function Events() {
|
||||
function getHoursAgo(hours: number): number {
|
||||
const now = new Date();
|
||||
now.setHours(now.getHours() - hours);
|
||||
return now.getTime() / 1000;
|
||||
return Math.ceil(now.getTime() / 1000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user