Skip to content

Commit 5eba770

Browse files
committed
Merge branch 'develop'
2 parents 7b1663f + 9438a31 commit 5eba770

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/app/content/views/Footer/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,13 @@ const Footer: FC = () => {
250250
const handleInjectImage = async (file: File) => {
251251
try {
252252
setInputLoading(true)
253-
const blob = await compressImage({ input: file, targetSize: 30 * 1024, outputType: 'image/webp' })
253+
254+
const blob = await compressImage({
255+
input: file,
256+
targetSize: 30 * 1024,
257+
outputType: file.size > 30 * 1024 ? 'image/webp' : undefined
258+
})
259+
254260
const base64 = await blobToBase64(blob)
255261
const hash = nanoid()
256262
const newMessage = `${message.slice(0, selectionEnd)}![Image](hash:${hash})${message.slice(selectionEnd)}`

0 commit comments

Comments
 (0)