feat: check if any pairs in workflow

This commit is contained in:
karishmas6
2024-10-08 19:12:40 +05:30
parent 86d065ac7a
commit 903ef5bd3d

View File

@@ -84,6 +84,14 @@ export const RightSidePanel: React.FC<RightSidePanelProps> = ({ onFinishCapture
}, [id, socket, workflowHandler]);
useEffect(() => {
const hasPairs = workflow.workflow.length > 0;
if (!hasPairs) {
setShowCaptureList(true);
setShowCaptureScreenshot(true);
setShowCaptureText(true);
return;
}
const hasScrapeListAction = workflow.workflow.some(pair =>
pair.what.some(action => action.action === "scrapeList")
);