Open created filter in command menu (#13379)
https://github.com/user-attachments/assets/d9fc9b9c-8632-4432-b0a4-899662476f09 Closes https://github.com/twentyhq/core-team-issues/issues/1225
This commit is contained in:
committed by
GitHub
parent
e34ac2967c
commit
6d3643bb4a
@@ -8,6 +8,7 @@ import {
|
||||
import { workflowSelectedNodeComponentState } from '@/workflow/workflow-diagram/states/workflowSelectedNodeComponentState';
|
||||
import { useCreateWorkflowVersionStep } from '@/workflow/workflow-steps/hooks/useCreateWorkflowVersionStep';
|
||||
import { useState } from 'react';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
export const useCreateStep = ({
|
||||
workflow,
|
||||
@@ -52,12 +53,14 @@ export const useCreateStep = ({
|
||||
})
|
||||
)?.data?.createWorkflowVersionStep;
|
||||
|
||||
if (!createdStep) {
|
||||
return;
|
||||
if (!isDefined(createdStep)) {
|
||||
throw new Error("Couldn't create step");
|
||||
}
|
||||
|
||||
setWorkflowSelectedNode(createdStep.id);
|
||||
setWorkflowLastCreatedStepId(createdStep.id);
|
||||
|
||||
return createdStep;
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user