SettingsPanel: OCR needed label for unreadable files, retry button enabled when OCR ships
This commit is contained in:
@@ -244,8 +244,14 @@ export default function SettingsPanel() {
|
|||||||
{f.error} {f.retry_count > 0 ? `(${f.retry_count} retr${f.retry_count === 1 ? 'y' : 'ies'})` : ''}
|
{f.error} {f.retry_count > 0 ? `(${f.retry_count} retr${f.retry_count === 1 ? 'y' : 'ies'})` : ''}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<SBtn onClick={() => retryFailure(f.source)} disabled={retrying === f.source || f.retry_count >= 2}>
|
<SBtn onClick={() => retryFailure(f.source)} disabled={
|
||||||
{retrying === f.source ? '...' : f.retry_count >= 2 ? 'Manual' : 'Retry'}
|
retrying === f.source ||
|
||||||
|
(f.retry_count >= 2 && !f.error.includes('Empty text') && !f.error.includes('scanned') && !f.error.includes('encrypted') && !f.error.includes('corrupt'))
|
||||||
|
}>
|
||||||
|
{retrying === f.source ? '...' :
|
||||||
|
(f.error.includes('Empty text') || f.error.includes('scanned') || f.error.includes('encrypted') || f.error.includes('corrupt'))
|
||||||
|
? 'OCR needed'
|
||||||
|
: f.retry_count >= 2 ? 'Manual' : 'Retry'}
|
||||||
</SBtn>
|
</SBtn>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Reference in New Issue
Block a user