Skip to content

Commit 5cb8005

Browse files
committed
run enabled after build and node creation enabled on create library clicked
1 parent e362bcf commit 5cb8005

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/component/modals/GraphCompDetails.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@ const ModalComp = ({ closeModal, superState, dispatcher }) => {
109109
}
110110
};
111111

112-
const createLibrary = () => {
112+
const createLibrary = (e) => {
113113
const fileName = data.label.split(':')[1];
114114
if (fileName === undefined || fileName === '') {
115115
toast.error('Enter File Name');
116116
return;
117117
}
118118
superState.curGraphInstance.library(fileName);
119+
submit(e);
119120
};
120121

121122
return (

src/graph-builder/graph-core/5-load-save.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,16 @@ class GraphLoadSave extends GraphUndoRedo {
121121
const stream = await handle.createWritable();
122122
await stream.write(blob);
123123
await stream.close();
124+
const fileData = await handle.getFile();
125+
let fS = this.superState.fileState;
126+
fS = fS.concat([{
127+
key: `${this.superState.uploadedDirName}/${handle.name}`,
128+
modified: fileData.lastModified,
129+
size: fileData.size,
130+
fileObj: fileData,
131+
fileHandle: handle,
132+
}]);
133+
this.dispatcher({ type: T.SET_FILE_STATE, payload: fS });
124134
} else {
125135
// eslint-disable-next-line no-alert
126136
const fileName = prompt('Filename:');

src/graph-builder/graph-core/6-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class GraphServer extends GraphLoadSave {
7979
this.dispatcher({
8080
type: T.SET_FUNCTIONS,
8181
payload: {
82-
built: false, ran: false, debugged: true, cleared: false, stopped: false, destroyed: true,
82+
built: false, ran: true, debugged: true, cleared: false, stopped: false, destroyed: true,
8383
},
8484
});
8585
this.dispatcher({ type: T.SET_LOGS_MESSAGE, payload: this.superState.logsmessage + res.data.output });

0 commit comments

Comments
 (0)