MCPcopy
hub / github.com/srcbookdev/srcbook / onSave

Function onSave

packages/components/src/components/cells/markdown.tsx:125–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123 );
124
125 function onSave() {
126 if (readOnly) {
127 return;
128 }
129 const error = getValidationError(text);
130
131 setError(error);
132
133 if (error === null) {
134 props.updateCellOnClient({ ...cell, text });
135 props.updateCellOnServer(cell, { text });
136 setStatus('view');
137 return true;
138 }
139 }
140
141 const deleteButton = !readOnly ? (
142 <DeleteCellWithConfirmation onDeleteCell={() => props.onDeleteCell(cell)}>

Callers 1

MarkdownCellFunction · 0.85

Calls 2

getValidationErrorFunction · 0.70
setErrorFunction · 0.50

Tested by

no test coverage detected