MCPcopy Create free account
hub / github.com/Microck/opencode-studio / handleToggle

Function handleToggle

client-next/src/app/plugins/page.tsx:40–49  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

38 };
39
40 const handleToggle = async (name: string) => {
41 try {
42 await togglePlugin(name);
43 const plugin = plugins.find(p => p.name === name);
44 toast.success(`${name} ${plugin?.enabled ? "disabled" : "enabled"}`);
45 } catch (err: any) {
46 const msg = err.response?.data?.error || err.message || "Unknown error";
47 toast.error(`Failed to toggle plugin: ${msg}`);
48 }
49 };
50
51 const handleDelete = async (name: string, type: 'file' | 'npm') => {
52 if (!confirm(`Delete ${name}?`)) return;

Callers 1

PluginsPageFunction · 0.70

Calls 1

togglePluginFunction · 0.85

Tested by

no test coverage detected