feat: emit getText action only if text steps present
This commit is contained in:
@@ -61,13 +61,15 @@ export const RightSidePanel = () => {
|
|||||||
}, [browserSteps]);
|
}, [browserSteps]);
|
||||||
|
|
||||||
|
|
||||||
const stopCaptureAndEmitGetTextSettings = useCallback(() => {
|
const stopCaptureAndEmitGetTextSettings = useCallback(() => {
|
||||||
stopGetText();
|
stopGetText();
|
||||||
const settings = getTextSettingsObject();
|
const settings = getTextSettingsObject();
|
||||||
if (browserSteps.length > 0) {
|
const hasTextSteps = browserSteps.some(step => step.type === 'text');
|
||||||
|
if (hasTextSteps) {
|
||||||
socket?.emit('action', { action: 'scrapeSchema', settings });
|
socket?.emit('action', { action: 'scrapeSchema', settings });
|
||||||
}
|
}
|
||||||
}, [stopGetText, getTextSettingsObject, socket]);
|
}, [stopGetText, getTextSettingsObject, socket, browserSteps]);
|
||||||
|
|
||||||
|
|
||||||
const captureScreenshot = (fullPage: boolean) => {
|
const captureScreenshot = (fullPage: boolean) => {
|
||||||
const screenshotSettings: ScreenshotSettings = {
|
const screenshotSettings: ScreenshotSettings = {
|
||||||
|
|||||||
Reference in New Issue
Block a user