mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 09:15:22 +03:00
fix: dialog import and video height fix
This commit is contained in:
parent
0c07eccbd1
commit
f671b99c52
@ -36,21 +36,13 @@ export const HistoryVideo = ({
|
|||||||
const [videoHeight, setVideoHeight] = useState<number>(undefined);
|
const [videoHeight, setVideoHeight] = useState<number>(undefined);
|
||||||
const [videoProperties, setVideoProperties] = useState<VideoProperties>(undefined);
|
const [videoProperties, setVideoProperties] = useState<VideoProperties>(undefined);
|
||||||
|
|
||||||
const initializeVideoContainerHeight = useCallback(() => {
|
const currentVideo = videoRef.current;
|
||||||
const video = videoRef.current;
|
if (currentVideo && !videoHeight) {
|
||||||
const videoExists = !isNullOrUndefined(video);
|
const currentVideoHeight = currentVideo.offsetHeight;
|
||||||
if (videoExists) {
|
if (currentVideoHeight > 0) {
|
||||||
const videoHeight = video.offsetHeight;
|
setVideoHeight(currentVideoHeight);
|
||||||
const videoHasHeight = videoHeight > 0;
|
|
||||||
if (videoHasHeight) {
|
|
||||||
setVideoHeight(videoHeight);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, [videoRef]);
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
initializeVideoContainerHeight();
|
|
||||||
}, [initializeVideoContainerHeight]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const idExists = !isNullOrUndefined(id);
|
const idExists = !isNullOrUndefined(id);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { h } from 'preact';
|
import { h } from 'preact';
|
||||||
import Dialog from '../Dialog';
|
import Dialog from '../Dialog';
|
||||||
import { fireEvent, render, screen } from '@testing-library/preact';
|
import { render, screen } from '@testing-library/preact';
|
||||||
|
|
||||||
describe('Dialog', () => {
|
describe('Dialog', () => {
|
||||||
let portal;
|
let portal;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user