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
This commit is contained in:
martmull
2025-01-07 10:59:19 +01:00
committed by GitHub
parent 00e71477d3
commit 1691fa5065
2 changed files with 3 additions and 12 deletions

View File

@ -1,8 +1,6 @@
import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient'; import { useApolloMetadataClient } from '@/object-metadata/hooks/useApolloMetadataClient';
import { UPDATE_ONE_SERVERLESS_FUNCTION } from '@/settings/serverless-functions/graphql/mutations/updateOneServerlessFunction'; 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 { useMutation } from '@apollo/client';
import { getOperationName } from '@apollo/client/utilities';
import { import {
UpdateOneServerlessFunctionMutation, UpdateOneServerlessFunctionMutation,
UpdateOneServerlessFunctionMutationVariables, UpdateOneServerlessFunctionMutationVariables,
@ -31,10 +29,6 @@ export const useUpdateOneServerlessFunction = (
variables: { variables: {
input: { ...input, id: serverlessFunctionId }, input: { ...input, id: serverlessFunctionId },
}, },
awaitRefetchQueries: true,
refetchQueries: [
getOperationName(FIND_ONE_SERVERLESS_FUNCTION_SOURCE_CODE) ?? '',
],
}); });
setIsReady(false); setIsReady(false);
return result; return result;

View File

@ -77,9 +77,8 @@ export const WorkflowEditActionFormServerlessFunction = ({
}: WorkflowEditActionFormServerlessFunctionProps) => { }: WorkflowEditActionFormServerlessFunctionProps) => {
const serverlessFunctionId = action.settings.input.serverlessFunctionId; const serverlessFunctionId = action.settings.input.serverlessFunctionId;
const theme = useTheme(); const theme = useTheme();
const { activeTabId, setActiveTabId } = useTabList( const tabListId = `${WORKFLOW_SERVERLESS_FUNCTION_TAB_LIST_COMPONENT_ID}_${serverlessFunctionId}`;
WORKFLOW_SERVERLESS_FUNCTION_TAB_LIST_COMPONENT_ID, const { activeTabId, setActiveTabId } = useTabList(tabListId);
);
const { updateOneServerlessFunction, isReady } = const { updateOneServerlessFunction, isReady } =
useUpdateOneServerlessFunction(serverlessFunctionId); useUpdateOneServerlessFunction(serverlessFunctionId);
const { getUpdatableWorkflowVersion } = useGetUpdatableWorkflowVersion(); const { getUpdatableWorkflowVersion } = useGetUpdatableWorkflowVersion();
@ -269,9 +268,7 @@ export const WorkflowEditActionFormServerlessFunction = ({
<StyledContainer> <StyledContainer>
<StyledTabListContainer> <StyledTabListContainer>
<TabList <TabList
tabListInstanceId={ tabListInstanceId={tabListId}
WORKFLOW_SERVERLESS_FUNCTION_TAB_LIST_COMPONENT_ID
}
tabs={tabs} tabs={tabs}
behaveAsLinks={false} behaveAsLinks={false}
/> />