feat: wrap pair action checkers in useEffect

This commit is contained in:
karishmas6
2024-10-08 18:52:53 +05:30
parent 50078eb276
commit 3eb30beb11

View File

@@ -83,6 +83,7 @@ export const RightSidePanel: React.FC<RightSidePanelProps> = ({ onFinishCapture
}; };
}, [id, socket, workflowHandler]); }, [id, socket, workflowHandler]);
useEffect(() => {
const hasScrapeListAction = workflow.workflow.some(pair => const hasScrapeListAction = workflow.workflow.some(pair =>
pair.what.some(action => action.action === "scrapeList") pair.what.some(action => action.action === "scrapeList")
); );
@@ -94,6 +95,7 @@ export const RightSidePanel: React.FC<RightSidePanelProps> = ({ onFinishCapture
const hasScrapeSchemaAction = workflow.workflow.some(pair => const hasScrapeSchemaAction = workflow.workflow.some(pair =>
pair.what.some(action => action.action === "scrapeSchema") pair.what.some(action => action.action === "scrapeSchema")
); );
}, [workflow]);
const handleTextLabelChange = (id: number, label: string, listId?: number, fieldKey?: string) => { const handleTextLabelChange = (id: number, label: string, listId?: number, fieldKey?: string) => {
if (listId !== undefined && fieldKey !== undefined) { if (listId !== undefined && fieldKey !== undefined) {