mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
Fix previews loading
This commit is contained in:
parent
22d977661a
commit
2d03c152fd
@ -50,12 +50,6 @@ export default function DynamicVideoPlayer({
|
||||
const apiHost = useApiHost();
|
||||
const { data: config } = useSWR<FrigateConfig>("config");
|
||||
|
||||
useEffect(() => {
|
||||
console.log(
|
||||
`the time range is ${new Date(timeRange.after * 1000)} -> ${new Date(timeRange.before * 1000)}`,
|
||||
);
|
||||
}, [timeRange]);
|
||||
|
||||
// controlling playback
|
||||
|
||||
const playerRef = useRef<HTMLVideoElement | null>(null);
|
||||
|
||||
@ -11,6 +11,7 @@ import {
|
||||
ReviewSeverity,
|
||||
ReviewSummary,
|
||||
} from "@/types/review";
|
||||
import { getUTCOffset } from "@/utils/dateUtil";
|
||||
import EventView from "@/views/events/EventView";
|
||||
import { RecordingView } from "@/views/events/RecordingView";
|
||||
import axios from "axios";
|
||||
@ -166,6 +167,8 @@ export default function Events() {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const timezoneMinuteOffset = (getUTCOffset(new Date()) % 60) * 60;
|
||||
|
||||
const startDate = new Date();
|
||||
startDate.setMinutes(0, 0, 0);
|
||||
|
||||
@ -173,8 +176,8 @@ export default function Events() {
|
||||
endDate.setHours(0, 0, 0, 0);
|
||||
|
||||
return {
|
||||
after: startDate.getTime() / 1000,
|
||||
before: endDate.getTime() / 1000,
|
||||
after: startDate.getTime() / 1000 + timezoneMinuteOffset,
|
||||
before: endDate.getTime() / 1000 + timezoneMinuteOffset,
|
||||
};
|
||||
}, [reviews]);
|
||||
|
||||
|
||||
@ -101,13 +101,6 @@ export function RecordingView({
|
||||
() => getChunkedTimeDay(timeRange),
|
||||
[timeRange],
|
||||
);
|
||||
useEffect(() => {
|
||||
chunkedTimeRange.forEach((c) =>
|
||||
console.log(
|
||||
`the chunk is ${new Date(c.after * 1000)} -> ${new Date(c.before * 1000)}`,
|
||||
),
|
||||
);
|
||||
}, [chunkedTimeRange]);
|
||||
const [selectedRangeIdx, setSelectedRangeIdx] = useState(
|
||||
chunkedTimeRange.findIndex((chunk) => {
|
||||
return chunk.after <= startTime && chunk.before >= startTime;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user