diff --git a/src/components/extensions/image/ImageModal.tsx b/src/components/extensions/image/ImageModal.tsx index 8f71ef12c..3963c2141 100644 --- a/src/components/extensions/image/ImageModal.tsx +++ b/src/components/extensions/image/ImageModal.tsx @@ -222,9 +222,12 @@ function ImageUpload({ initialImage, setUploadedImageLink }: ImageUploadProps) { setImageUrl('')} src={imageUrl} - onLoad={() => - setUploadedImageLink((prev) => ({ ...prev, loadedLink: imageUrl })) - } + onLoad={() => { + // To prevent this called first before the useEffect, which causes image rendered, but the link is null + setTimeout(() => { + setUploadedImageLink((prev) => ({ ...prev, loadedLink: imageUrl })) + }) + }} /> ) }