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={() => {
|
||||
setHasLoaded(true);
|
||||
|
||||
if (imgRef.current) {
|
||||
const { naturalHeight, naturalWidth } = imgRef.current;
|
||||
setIsPortraitImage(naturalHeight > naturalWidth);
|
||||
}
|
||||
|
||||
if (onload) {
|
||||
if (imgRef.current) {
|
||||
const { naturalHeight, naturalWidth } = imgRef.current;
|
||||
setIsPortraitImage(naturalHeight > naturalWidth);
|
||||
}
|
||||
onload();
|
||||
}
|
||||
}}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user