From b21205635691e3893f8efbcc5610c19bfd6a2b68 Mon Sep 17 00:00:00 2001 From: icarus Date: Sun, 24 Aug 2025 00:05:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(ocr):=20=E4=BF=AE=E5=A4=8DocrImage=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E6=9C=AA=E4=BD=BF=E7=94=A8await=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/hooks/useOcr.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/hooks/useOcr.ts b/src/renderer/src/hooks/useOcr.ts index aadc291ad8..a1cbac0f8f 100644 --- a/src/renderer/src/hooks/useOcr.ts +++ b/src/renderer/src/hooks/useOcr.ts @@ -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 }))