fix: preview for capture text action

This commit is contained in:
Rohit Rajan
2025-11-10 11:30:01 +05:30
parent 653a332524
commit 141316d353

View File

@@ -306,6 +306,8 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
shouldOpenDrawer = true; shouldOpenDrawer = true;
} }
lastListDataLength.current = captureListData.length; lastListDataLength.current = captureListData.length;
} else if (hasScrapeListAction && captureListData.length === 0) {
lastListDataLength.current = 0;
} }
if (hasScrapeSchemaAction && captureTextData.length > 0 && !getText) { if (hasScrapeSchemaAction && captureTextData.length > 0 && !getText) {
@@ -315,6 +317,8 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
shouldOpenDrawer = true; shouldOpenDrawer = true;
} }
lastTextDataLength.current = captureTextData.length; lastTextDataLength.current = captureTextData.length;
} else if (hasScrapeSchemaAction && captureTextData.length === 0) {
lastTextDataLength.current = 0;
} }
if (hasScreenshotAction && screenshotData.length > 0) { if (hasScreenshotAction && screenshotData.length > 0) {
@@ -324,6 +328,8 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
shouldOpenDrawer = true; shouldOpenDrawer = true;
} }
lastScreenshotDataLength.current = screenshotData.length; lastScreenshotDataLength.current = screenshotData.length;
} else if (hasScreenshotAction && screenshotData.length === 0) {
lastScreenshotDataLength.current = 0;
} }
const getLatestCaptureType = () => { const getLatestCaptureType = () => {
@@ -466,7 +472,7 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
{t('interpretation_log.titles.output_preview')} {t('interpretation_log.titles.output_preview')}
</Typography> </Typography>
{!(hasScrapeListAction || hasScrapeSchemaAction || hasScreenshotAction) && ( {!(hasScrapeListAction || hasScrapeSchemaAction || hasScreenshotAction) && !showPreviewData && availableTabs.length === 0 && (
<Grid container justifyContent="center" alignItems="center" style={{ height: '100%' }}> <Grid container justifyContent="center" alignItems="center" style={{ height: '100%' }}>
<Grid item> <Grid item>
<Typography variant="h6" gutterBottom align="left"> <Typography variant="h6" gutterBottom align="left">