MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / toggle

Function toggle

ui-tui/src/components/pluginsHub.tsx:81–100  ·  view source on GitHub ↗
(row: PluginRow)

Source from the content-addressed store, hash-verified

79 useOverlayKeys({ disabled: busy, onClose })
80
81 const toggle = (row: PluginRow) => {
82 if (busy || !row) {
83 return
84 }
85
86 const enable = row.status !== 'enabled'
87 setBusy(true)
88 setErr('')
89
90 gw.request<PluginsToggleResponse>('plugins.manage', { action: 'toggle', enable, name: row.name })
91 .then(r => {
92 if (r?.plugin) {
93 setRows(prev => prev.map(p => (p.name === r.plugin!.name ? r.plugin! : p)))
94 } else {
95 load()
96 }
97 })
98 .catch((e: unknown) => setErr(rpcErrorMessage(e)))
99 .finally(() => setBusy(false))
100 }
101
102 useInput((ch, key) => {
103 if (busy) {

Callers 1

PluginsHubFunction · 0.85

Calls 3

rpcErrorMessageFunction · 0.85
loadFunction · 0.70
requestMethod · 0.45

Tested by

no test coverage detected