mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 13:45:25 +03:00
move calc into onLoad
This commit is contained in:
parent
efde23ed81
commit
d55d862d3e
@ -45,11 +45,12 @@ export default function CameraImage({
|
|||||||
onLoad={() => {
|
onLoad={() => {
|
||||||
setHasLoaded(true);
|
setHasLoaded(true);
|
||||||
|
|
||||||
if (onload) {
|
|
||||||
if (imgRef.current) {
|
if (imgRef.current) {
|
||||||
const { naturalHeight, naturalWidth } = imgRef.current;
|
const { naturalHeight, naturalWidth } = imgRef.current;
|
||||||
setIsPortraitImage(naturalHeight > naturalWidth);
|
setIsPortraitImage(naturalHeight > naturalWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (onload) {
|
||||||
onload();
|
onload();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user