mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-08-26 14:19:24 +00:00
Fix infinite loops
This commit is contained in:
parent
bd9c6f9a03
commit
555d937921
@ -57,11 +57,14 @@ export default function AutomationRun({ automation, onBack, onComplete, automate
|
|||||||
});
|
});
|
||||||
setExecutionSteps(steps);
|
setExecutionSteps(steps);
|
||||||
}
|
}
|
||||||
// Initialize current files with active files
|
}, [automation]); // Remove toolRegistry from dependencies to prevent infinite loops
|
||||||
if (activeFiles) {
|
|
||||||
|
// Initialize current files with active files (separate effect)
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (activeFiles && activeFiles.length > 0) {
|
||||||
setCurrentFiles([...activeFiles]);
|
setCurrentFiles([...activeFiles]);
|
||||||
}
|
}
|
||||||
}, [automation, toolRegistry, activeFiles]);
|
}, [activeFiles?.length]); // Only depend on length to avoid infinite loops
|
||||||
|
|
||||||
const executeAutomation = async () => {
|
const executeAutomation = async () => {
|
||||||
if (!activeFiles || activeFiles.length === 0) {
|
if (!activeFiles || activeFiles.length === 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user