MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / change

Function change

graph-ui/src/system/IndexesPanel.tsx:43–49  ·  view source on GitHub ↗
(enabled: boolean)

Source from the content-addressed store, hash-verified

41 const saved = setting?.override ?? setting?.value;
42 const known = saved === 'true' || saved === 'false';
43 const change = async (enabled: boolean) => {
44 if (!snapshot || !setting?.editable || !api.saveConfiguration || pending.current) return;
45 pending.current = true; setSaving(true); setOptimistic(enabled); setSaveError('');
46 try { setSnapshot(await api.saveConfiguration(snapshot.revision, { watcher_enabled: enabled ? 'true' : 'false' })); }
47 catch (error) { setSaveError(`Could not save the watcher setting. ${failureText(error)}`); }
48 finally { pending.current = false; setSaving(false); setOptimistic(null); }
49 };
50 return <section className="system-watcher-setting" aria-label="Background watcher configuration">
51 <label className="system-watcher-toggle"><input type="checkbox" role="switch" aria-label="Background watcher" checked={optimistic ?? saved === 'true'} disabled={!known || !setting?.editable || !api.saveConfiguration || saving || !!reading.error || reading.loading} onChange={event => { void change(event.currentTarget.checked); }} /><span>Background watcher <small>Applies after daemon restart</small></span></label>
52 <div className="system-watcher-details"><span>{saving ? 'Saving…' : `Saved: ${booleanText(saved)}`}</span><span>Running setting: {setting?.effectiveKnown === false ? 'Unknown' : booleanText(setting?.effective)}</span>{setting?.pendingRestart && <strong>Restart pending</strong>}</div>

Callers 3

WatcherSettingFunction · 0.70
SettingsPanelFunction · 0.50

Calls 2

failureTextFunction · 0.85
saveConfigurationMethod · 0.65

Tested by

no test coverage detected