MCPcopy Create free account
hub / github.com/TheCSir/TerminalStart / removeExtraWidget

Function removeExtraWidget

src/contexts/AppContext.tsx:339–355  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

337 };
338
339 const removeExtraWidget = (key: string) => {
340 setActiveWidgets(prev => {
341 const next = { ...prev };
342 delete next[key];
343 return next;
344 });
345
346 setLayouts(prev => {
347 const nextLayouts = { ...prev } as Layouts;
348 Object.keys(nextLayouts).forEach(bp => {
349 if (nextLayouts[bp]) {
350 nextLayouts[bp] = nextLayouts[bp].filter(item => item.i !== key);
351 }
352 });
353 return nextLayouts;
354 });
355 };
356
357 const toggleWidget = (key: string) => {
358 if (key.includes('-') && activeWidgets[key]) {

Callers 2

AppContentFunction · 0.85
toggleWidgetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected