Skip to content

Commit

Permalink
Use correct method for retrieving current unix time (#6218)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Apr 24, 2023
1 parent 04a22f8 commit 7f96d89
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions web/src/components/TimelineSummary.jsx
Expand Up @@ -7,7 +7,6 @@ import ExitIcon from '../icons/Exit';
import { Zone } from '../icons/Zone';
import { useState } from 'preact/hooks';
import Button from './Button';
import { getUnixTime } from 'date-fns';

export default function TimelineSummary({ event, onFrameSelected }) {
const { data: eventTimeline } = useSWR([
Expand All @@ -22,7 +21,7 @@ export default function TimelineSummary({ event, onFrameSelected }) {
const [timeIndex, setTimeIndex] = useState(-1);

const recordingParams = {
before: event.end_time || getUnixTime(),
before: event.end_time || Date.now(),
after: event.start_time,
};
const { data: recordings } = useSWR([`${event.camera}/recordings`, recordingParams], { revalidateOnFocus: false });
Expand Down

0 comments on commit 7f96d89

Please sign in to comment.