diff --git a/src/app/note/components/ImageNote.tsx b/src/app/note/components/ImageNote.tsx
index 5ea7e67f..c07d9552 100644
--- a/src/app/note/components/ImageNote.tsx
+++ b/src/app/note/components/ImageNote.tsx
@@ -6,6 +6,7 @@ import {
} from "@tabler/icons-react"
import { useEffect, useRef, useContext, useState } from "react"
import classNames from "classnames"
+import { classListAddAll, classListRemoveAll } from "../utils/classListAll.ts"
export interface Props {
imageBlob: Blob
@@ -13,28 +14,43 @@ export interface Props {
}
export default (props: Props) => {
const userState = useContext(UserStateContext)
- const blobUrl = URL.createObjectURL(props.imageBlob)
const [imageSize, setImageSize] = useState({
width: 1,
height: 1,
})
-
- const image = new Image()
- image.onload = () => {
- setImageSize({
- width: image.width,
- height: image.height
- })
- }
- image.src = blobUrl
+ const [blobUrl, setBlobUrl] = useState('')
+ useEffect(() => {
+ const blobUrl = URL.createObjectURL(props.imageBlob)
+ const image = new Image()
+ image.onload = () => {
+ setImageSize({
+ width: image.width,
+ height: image.height
+ })
+ }
+ setBlobUrl(blobUrl)
+ image.src = blobUrl
+ }, [])
+
return
-