fix(ocr): 修复ocrImage函数未使用await导致的问题

This commit is contained in:
icarus 2025-08-24 00:05:43 +08:00
parent 07c7c33310
commit b212056356

View File

@ -31,9 +31,10 @@ export const useOcr = () => {
const ocr = async (file: SupportedOcrFile) => {
const key = uuid()
window.message.loading({ content: t('ocr.processing'), key, duration: 0 })
// await to keep show loading message
try {
if (isImageFile(file)) {
return ocrImage(file)
return await ocrImage(file)
} else {
// @ts-expect-error all types should be covered
throw new Error(t('ocr.file.not_supported', { type: file.type }))