Skip to content

Commit 2b85a04

Browse files
authored
Merge pull request #881 from getmaxun/preview-fix
fix: output preview for capture text action
2 parents 865a7ab + 141316d commit 2b85a04

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/run/InterpretationLog.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
332332
shouldOpenDrawer = true;
333333
}
334334
lastListDataLength.current = captureListData.length;
335+
} else if (hasScrapeListAction && captureListData.length === 0) {
336+
lastListDataLength.current = 0;
335337
}
336338

337339
if (hasScrapeSchemaAction && captureTextData.length > 0 && !getText) {
@@ -341,6 +343,8 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
341343
shouldOpenDrawer = true;
342344
}
343345
lastTextDataLength.current = captureTextData.length;
346+
} else if (hasScrapeSchemaAction && captureTextData.length === 0) {
347+
lastTextDataLength.current = 0;
344348
}
345349

346350
if (hasScreenshotAction && screenshotData.length > 0) {
@@ -350,6 +354,8 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
350354
shouldOpenDrawer = true;
351355
}
352356
lastScreenshotDataLength.current = screenshotData.length;
357+
} else if (hasScreenshotAction && screenshotData.length === 0) {
358+
lastScreenshotDataLength.current = 0;
353359
}
354360

355361
const getLatestCaptureType = () => {
@@ -492,7 +498,7 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
492498
{t('interpretation_log.titles.output_preview')}
493499
</Typography>
494500

495-
{!(hasScrapeListAction || hasScrapeSchemaAction || hasScreenshotAction) && (
501+
{!(hasScrapeListAction || hasScrapeSchemaAction || hasScreenshotAction) && !showPreviewData && availableTabs.length === 0 && (
496502
<Grid container justifyContent="center" alignItems="center" style={{ height: '100%' }}>
497503
<Grid item>
498504
<Typography variant="h6" gutterBottom align="left">

0 commit comments

Comments
 (0)