fix(ui): loading library workflows

This commit is contained in:
psychedelicious 2024-05-17 18:51:34 +10:00
parent 922716d2ab
commit 799cf06d20

View File

@ -27,8 +27,9 @@ export const useGetAndLoadLibraryWorkflow: UseGetAndLoadLibraryWorkflow = ({ onS
const getAndLoadWorkflow = useCallback(
async (workflow_id: string) => {
try {
const data = await _getAndLoadWorkflow(workflow_id).unwrap();
dispatch(workflowLoadRequested({ workflow: data.workflow, asCopy: false }));
const { workflow } = await _getAndLoadWorkflow(workflow_id).unwrap();
// This action expects a stringified workflow, instead of updating the routes and services we will just stringify it here
dispatch(workflowLoadRequested({ data: { workflow: JSON.stringify(workflow), graph: null }, asCopy: false }));
// No toast - the listener for this action does that after the workflow is loaded
onSuccess && onSuccess();
} catch {