mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-08 14:29:15 +08:00
fix(ocr): include imageProviderId in error message and dependencies
Add imageProviderId to error message for better debugging and include it in useCallback dependencies to ensure consistency
This commit is contained in:
parent
d19e0de486
commit
4f2eaf4aed
@ -15,7 +15,7 @@ const isProviderAvailable = (provider: OcrProvider | undefined | null): provider
|
|||||||
|
|
||||||
export const useOcr = () => {
|
export const useOcr = () => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { imageProvider } = useOcrImageProvider()
|
const { imageProvider, imageProviderId } = useOcrImageProvider()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对图片文件进行OCR识别
|
* 对图片文件进行OCR识别
|
||||||
@ -31,10 +31,10 @@ export const useOcr = () => {
|
|||||||
providerId: imageProvider.id
|
providerId: imageProvider.id
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
throw new Error(t('ocr.error.provider.not_availabel'))
|
throw new Error(t('ocr.error.provider.not_availabel', { provider: imageProviderId }))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[imageProvider, t]
|
[imageProvider, imageProviderId, t]
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user