Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
molvqingtai committed Nov 6, 2024
2 parents 7b1663f + 9438a31 commit 5eba770
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/content/views/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,13 @@ const Footer: FC = () => {
const handleInjectImage = async (file: File) => {
try {
setInputLoading(true)
const blob = await compressImage({ input: file, targetSize: 30 * 1024, outputType: 'image/webp' })

const blob = await compressImage({
input: file,
targetSize: 30 * 1024,
outputType: file.size > 30 * 1024 ? 'image/webp' : undefined
})

const base64 = await blobToBase64(blob)
const hash = nanoid()
const newMessage = `${message.slice(0, selectionEnd)}![Image](hash:${hash})${message.slice(selectionEnd)}`
Expand Down

0 comments on commit 5eba770

Please sign in to comment.