mirror of
				https://github.com/langgenius/dify.git
				synced 2025-10-31 19:03:09 +00:00 
			
		
		
		
	
		
			
	
	
		
			18 lines
		
	
	
		
			598 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			18 lines
		
	
	
		
			598 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
|   | import { useCallback } from 'react' | ||
|  | import { useStore as usePluginDependenciesStore } from './store' | ||
|  | import { useMutationCheckDependencies } from '@/service/use-plugins' | ||
|  | 
 | ||
|  | export const usePluginDependencies = () => { | ||
|  |   const { mutateAsync } = useMutationCheckDependencies() | ||
|  | 
 | ||
|  |   const handleCheckPluginDependencies = useCallback(async (appId: string) => { | ||
|  |     const { leaked_dependencies } = await mutateAsync(appId) | ||
|  |     const { setDependencies } = usePluginDependenciesStore.getState() | ||
|  |     setDependencies(leaked_dependencies) | ||
|  |   }, [mutateAsync]) | ||
|  | 
 | ||
|  |   return { | ||
|  |     handleCheckPluginDependencies, | ||
|  |   } | ||
|  | } |