mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix autoplay (#10099)
This commit is contained in:
parent
d94710171d
commit
8663fbba01
@ -101,10 +101,6 @@ export default function MobileEventView({
|
|||||||
const [minimap, setMinimap] = useState<string[]>([]);
|
const [minimap, setMinimap] = useState<string[]>([]);
|
||||||
const minimapObserver = useRef<IntersectionObserver | null>();
|
const minimapObserver = useRef<IntersectionObserver | null>();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!contentRef.current) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const visibleTimestamps = new Set<string>();
|
const visibleTimestamps = new Set<string>();
|
||||||
minimapObserver.current = new IntersectionObserver(
|
minimapObserver.current = new IntersectionObserver(
|
||||||
(entries) => {
|
(entries) => {
|
||||||
@ -130,7 +126,7 @@ export default function MobileEventView({
|
|||||||
return () => {
|
return () => {
|
||||||
minimapObserver.current?.disconnect();
|
minimapObserver.current?.disconnect();
|
||||||
};
|
};
|
||||||
}, [contentRef]);
|
}, []);
|
||||||
const minimapRef = useCallback(
|
const minimapRef = useCallback(
|
||||||
(node: HTMLElement | null) => {
|
(node: HTMLElement | null) => {
|
||||||
if (!minimapObserver.current) {
|
if (!minimapObserver.current) {
|
||||||
@ -147,8 +143,8 @@ export default function MobileEventView({
|
|||||||
);
|
);
|
||||||
const minimapBounds = useMemo(() => {
|
const minimapBounds = useMemo(() => {
|
||||||
const data = {
|
const data = {
|
||||||
start: Math.floor(Date.now() / 1000) - 35 * 60,
|
start: 0,
|
||||||
end: Math.floor(Date.now() / 1000) - 21 * 60,
|
end: 0,
|
||||||
};
|
};
|
||||||
const list = minimap.sort();
|
const list = minimap.sort();
|
||||||
|
|
||||||
@ -217,7 +213,7 @@ export default function MobileEventView({
|
|||||||
>
|
>
|
||||||
{currentItems ? (
|
{currentItems ? (
|
||||||
currentItems.map((value, segIdx) => {
|
currentItems.map((value, segIdx) => {
|
||||||
const lastRow = segIdx == reviewItems[severity].length - 1;
|
const lastRow = segIdx == currentItems.length - 1;
|
||||||
const relevantPreview = Object.values(relevantPreviews || []).find(
|
const relevantPreview = Object.values(relevantPreviews || []).find(
|
||||||
(preview) =>
|
(preview) =>
|
||||||
preview.camera == value.camera &&
|
preview.camera == value.camera &&
|
||||||
|
Loading…
Reference in New Issue
Block a user