mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 01:05:20 +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 [videoProperties, setVideoProperties] = useState<VideoProperties>(undefined);
|
||||
|
||||
const initializeVideoContainerHeight = useCallback(() => {
|
||||
const video = videoRef.current;
|
||||
const videoExists = !isNullOrUndefined(video);
|
||||
if (videoExists) {
|
||||
const videoHeight = video.offsetHeight;
|
||||
const videoHasHeight = videoHeight > 0;
|
||||
if (videoHasHeight) {
|
||||
setVideoHeight(videoHeight);
|
||||
}
|
||||
const currentVideo = videoRef.current;
|
||||
if (currentVideo && !videoHeight) {
|
||||
const currentVideoHeight = currentVideo.offsetHeight;
|
||||
if (currentVideoHeight > 0) {
|
||||
setVideoHeight(currentVideoHeight);
|
||||
}
|
||||
}, [videoRef]);
|
||||
|
||||
useEffect(() => {
|
||||
initializeVideoContainerHeight();
|
||||
}, [initializeVideoContainerHeight]);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const idExists = !isNullOrUndefined(id);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { h } from 'preact';
|
||||
import Dialog from '../Dialog';
|
||||
import { fireEvent, render, screen } from '@testing-library/preact';
|
||||
import { render, screen } from '@testing-library/preact';
|
||||
|
||||
describe('Dialog', () => {
|
||||
let portal;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user