From 1691fa5065cd726b50dde9e63573dc46dbd473f0 Mon Sep 17 00:00:00 2001 From: martmull Date: Tue, 7 Jan 2025 10:59:19 +0100 Subject: [PATCH] Remove buggy refetch query (#9420) - Fixes flash when writing code in workflow code steps - Fixes tab selection collusion when switching code steps https://github.com/user-attachments/assets/45e884a7-6765-4596-b37f-3a22dd78664f --- .../hooks/useUpdateOneServerlessFunction.ts | 6 ------ .../WorkflowEditActionFormServerlessFunction.tsx | 9 +++------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/twenty-front/src/modules/settings/serverless-functions/hooks/useUpdateOneServerlessFunction.ts b/packages/twenty-front/src/modules/settings/serverless-functions/hooks/useUpdateOneServerlessFunction.ts index 0c0284570..ffc337d24 100644 --- a/packages/twenty-front/src/modules/settings/serverless-functions/hooks/useUpdateOneServerlessFunction.ts +++ b/packages/twenty-front/src/modules/settings/serverless-functions/hooks/useUpdateOneServerlessFunction.ts @@ -1,8 +1,6 @@ import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient'; import { UPDATE_ONE_SERVERLESS_FUNCTION } from '@/settings/serverless-functions/graphql/mutations/updateOneServerlessFunction'; -import { FIND_ONE_SERVERLESS_FUNCTION_SOURCE_CODE } from '@/settings/serverless-functions/graphql/queries/findOneServerlessFunctionSourceCode'; import { useMutation } from '@apollo/client'; -import { getOperationName } from '@apollo/client/utilities'; import { UpdateOneServerlessFunctionMutation, UpdateOneServerlessFunctionMutationVariables, @@ -31,10 +29,6 @@ export const useUpdateOneServerlessFunction = ( variables: { input: { ...input, id: serverlessFunctionId }, }, - awaitRefetchQueries: true, - refetchQueries: [ - getOperationName(FIND_ONE_SERVERLESS_FUNCTION_SOURCE_CODE) ?? '', - ], }); setIsReady(false); return result; diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionFormServerlessFunction.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionFormServerlessFunction.tsx index 5b843afe4..fb76b0fc6 100644 --- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionFormServerlessFunction.tsx +++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionFormServerlessFunction.tsx @@ -77,9 +77,8 @@ export const WorkflowEditActionFormServerlessFunction = ({ }: WorkflowEditActionFormServerlessFunctionProps) => { const serverlessFunctionId = action.settings.input.serverlessFunctionId; const theme = useTheme(); - const { activeTabId, setActiveTabId } = useTabList( - WORKFLOW_SERVERLESS_FUNCTION_TAB_LIST_COMPONENT_ID, - ); + const tabListId = `${WORKFLOW_SERVERLESS_FUNCTION_TAB_LIST_COMPONENT_ID}_${serverlessFunctionId}`; + const { activeTabId, setActiveTabId } = useTabList(tabListId); const { updateOneServerlessFunction, isReady } = useUpdateOneServerlessFunction(serverlessFunctionId); const { getUpdatableWorkflowVersion } = useGetUpdatableWorkflowVersion(); @@ -269,9 +268,7 @@ export const WorkflowEditActionFormServerlessFunction = ({