MCPcopy Create free account
hub / github.com/Botloader/botloader / save

Function save

frontend/src/components/ScriptEditor.tsx:103–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101
102 let isSaving = false;
103 async function save() {
104 if (!monacoRef.current) {
105 return
106 }
107
108 await monacoRef.current.getAction('editor.action.formatDocument')?.run()
109 const value = monacoRef.current.getValue();
110
111 let innerIsDirty = value !== selectedFile?.content
112
113 if (!innerIsDirty || isSaving) {
114 return;
115 }
116
117 await props.onSave(value);
118 }
119
120 function onValueChange(value: string | undefined) {
121 // editedValue.current = value || "";

Callers 1

handleKeyDownFunction · 0.70

Calls 1

runMethod · 0.45

Tested by

no test coverage detected