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 { 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;

View File

@ -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 = ({
<StyledContainer>
<StyledTabListContainer>
<TabList
tabListInstanceId={
WORKFLOW_SERVERLESS_FUNCTION_TAB_LIST_COMPONENT_ID
}
tabListInstanceId={tabListId}
tabs={tabs}
behaveAsLinks={false}
/>