MCPcopy Create free account
hub / github.com/coder/mux / handleSubmitRename

Function handleSubmitRename

src/browser/components/SectionHeader/SectionHeader.tsx:86–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84 }, [isEditing]);
85
86 const handleSubmitRename = () => {
87 const trimmed = editValue.trim();
88 if (trimmed && trimmed !== section.name) {
89 onRename(trimmed);
90 } else if (onAutoCreateRenameCancel) {
91 // Blur/submit with no committed rename should exit auto-create mode,
92 // otherwise a later Escape can still route through abandon/delete.
93 onAutoCreateRenameCancel();
94 setEditValue(section.name);
95 } else {
96 setEditValue(section.name);
97 }
98 setHasEditedName(false);
99 setIsEditing(false);
100 };
101
102 const sectionColor = resolveSectionColor(section.color);
103

Callers 1

SectionHeaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected