File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed
client/src/ee/pages/embedded/automation-workflows/workflow-builder/config Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -2,26 +2,17 @@ import {useToast} from '@/hooks/use-toast';
22import { useWorkspaceStore } from '@/pages/automation/stores/useWorkspaceStore' ;
33import { useAuthenticationStore } from '@/shared/stores/useAuthenticationStore' ;
44import { useEnvironmentStore } from '@/shared/stores/useEnvironmentStore' ;
5- import { useEffect , useState } from 'react ' ;
5+ import fetchIntercept from 'fetch-intercept ' ;
66
77export default function useFetchInterceptor ( ) {
88 const clearAuthentication = useAuthenticationStore ( ( state ) => state . clearAuthentication ) ;
99 const clearCurrentEnvironmentId = useEnvironmentStore ( ( state ) => state . clearCurrentEnvironmentId ) ;
1010 const clearCurrentWorkspaceId = useWorkspaceStore ( ( state ) => state . clearCurrentWorkspaceId ) ;
11- const [ fetchIntercept , setFetchIntercept ] = useState < typeof import ( 'fetch-intercept' ) | null > ( null ) ;
1211
1312 const { toast} = useToast ( ) ;
1413
1514 const apiBasePath = import . meta. env . VITE_API_BASE_PATH ;
1615
17- useEffect ( ( ) => {
18- import ( 'fetch-intercept' ) . then ( ( module ) => setFetchIntercept ( module ) ) ;
19- } , [ ] ) ;
20-
21- if ( ! fetchIntercept ) {
22- return { unregister : ( ) => { } } ;
23- }
24-
2516 const unregister = fetchIntercept . register ( {
2617 /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
2718 request ( url : string , config : any ) : Promise < any [ ] > | any [ ] {
You can’t perform that action at this time.
0 commit comments