reload server

This commit is contained in:
zhandouxiaojiji committed 2020-11-20 17:50:52 +08:00
1 parent c7f65abccf
commit 130aec7363
7 files changed
+203 -35

No files matched your search

+7 -5
View File
@@ -332,14 +332,16 @@ export default class Editor extends React.Component<EditorProps, EditorState> {
save() {
const { filepath } = this.props;
const root = Utils.createFileData(this.graph.findDataById("1") as GraphNodeModel);
const treeModel = {
name: path.basename(filepath).slice(0, -5),
root,
desc: root.desc,
} as BehaviorTreeModel;
fs.writeFileSync(
filepath,
JSON.stringify({
name: path.basename(filepath).slice(0, -5),
root,
desc: root.desc,
})
JSON.stringify(treeModel)
);
return treeModel;
}
copyNode() {