mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-29 23:12:38 +08:00
feat(翻译页面): 添加OCR处理中的加载状态提示
在翻译页面中添加OCR处理时的加载状态提示,提升用户体验
This commit is contained in:
parent
c5d7d7b849
commit
377d75366e
@ -1561,7 +1561,8 @@
|
||||
"ocr": {
|
||||
"file": {
|
||||
"not_supported": "不支持的文件类型 {{type}}"
|
||||
}
|
||||
},
|
||||
"processing": "OCR 处理中..."
|
||||
},
|
||||
"ollama": {
|
||||
"keep_alive_time": {
|
||||
|
||||
@ -440,6 +440,7 @@ const TranslatePage: FC = () => {
|
||||
try {
|
||||
const [file] = await onSelectFile({ multipleSelections: false })
|
||||
if (isSupportedOcrFile(file)) {
|
||||
window.message.loading({ content: t('ocr.processing'), key: 'translate_ocr_processing' })
|
||||
const ocrResult = await ocr(file)
|
||||
setText(ocrResult.text)
|
||||
} else {
|
||||
@ -450,6 +451,7 @@ const TranslatePage: FC = () => {
|
||||
window.message.error(formatErrorMessage(e))
|
||||
} finally {
|
||||
setIsProcessing(false)
|
||||
window.message.destroy('translate_ocr_processing')
|
||||
}
|
||||
}, [ocr, onSelectFile, selecting, t])
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user