feat: emit capture text setting if no labels are empty in text steps

This commit is contained in:
karishmas6
2024-08-06 05:12:08 +05:30
parent de21f701a2
commit 18bd805199

View File

@@ -62,13 +62,19 @@ export const RightSidePanel = () => {
const stopCaptureAndEmitGetTextSettings = useCallback(() => {
const hasUnconfirmedTextSteps = browserSteps.some(step => step.type === 'text' && !confirmedTextSteps[step.id]);
if (hasUnconfirmedTextSteps) {
alert('Please confirm all text labels before proceeding.');
return;
}
stopGetText();
const settings = getTextSettingsObject();
const hasTextSteps = browserSteps.some(step => step.type === 'text');
if (hasTextSteps) {
socket?.emit('action', { action: 'scrapeSchema', settings });
}
}, [stopGetText, getTextSettingsObject, socket, browserSteps]);
}, [stopGetText, getTextSettingsObject, socket, browserSteps, confirmedTextSteps]);
const captureScreenshot = (fullPage: boolean) => {