mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-27 11:51:13 +01:00
Refactor plugin manager and gRPC server (#96)
This commit is contained in:
14
src-web/hooks/useUninstallPlugin.ts
Normal file
14
src-web/hooks/useUninstallPlugin.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import type { Plugin } from '@yaakapp/api';
|
||||
import { trackEvent } from '../lib/analytics';
|
||||
import { invokeCmd } from '../lib/tauri';
|
||||
|
||||
export function useUninstallPlugin(pluginId: string) {
|
||||
return useMutation<Plugin | null, string>({
|
||||
mutationKey: ['uninstall_plugin'],
|
||||
mutationFn: async () => {
|
||||
return invokeCmd('cmd_uninstall_plugin', { pluginId });
|
||||
},
|
||||
onSettled: () => trackEvent('plugin', 'delete'),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user