MCPcopy Create free account
hub / github.com/SensAI-PT/RAGMeUp / handleAddVariable

Function handleAddVariable

ui/node-react/client/src/components/ConfigPage.js:204–217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

202 };
203
204 const handleAddVariable = () => {
205 const key = newVarKey.trim();
206 if (!key) return;
207 if (key in config || key in editedKeys) {
208 setMessage({ type: 'error', text: `Variable "${key}" already exists. Edit it above instead.` });
209 return;
210 }
211 setEditedKeys((prev) => ({ ...prev, [key]: newVarValue }));
212 setAddedKeys((prev) => [...prev, key]);
213 setNewVarKey('');
214 setNewVarValue('');
215 // Make sure the Other section is expanded
216 setExpandedSections((prev) => ({ ...prev, Other: true }));
217 };
218
219 const toggleSection = (title) => {
220 setExpandedSections((prev) => ({ ...prev, [title]: !prev[title] }));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected