Skip to content

Commit

Permalink
run enabled after build and node creation enabled on create library c…
Browse files Browse the repository at this point in the history
…licked
  • Loading branch information
Rahuljagwani committed Aug 4, 2023
1 parent e362bcf commit 5cb8005
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/component/modals/GraphCompDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,14 @@ const ModalComp = ({ closeModal, superState, dispatcher }) => {
}
};

const createLibrary = () => {
const createLibrary = (e) => {
const fileName = data.label.split(':')[1];
if (fileName === undefined || fileName === '') {
toast.error('Enter File Name');
return;
}
superState.curGraphInstance.library(fileName);
submit(e);
};

return (
Expand Down
10 changes: 10 additions & 0 deletions src/graph-builder/graph-core/5-load-save.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ class GraphLoadSave extends GraphUndoRedo {
const stream = await handle.createWritable();
await stream.write(blob);
await stream.close();
const fileData = await handle.getFile();
let fS = this.superState.fileState;
fS = fS.concat([{
key: `${this.superState.uploadedDirName}/${handle.name}`,
modified: fileData.lastModified,
size: fileData.size,
fileObj: fileData,
fileHandle: handle,
}]);
this.dispatcher({ type: T.SET_FILE_STATE, payload: fS });
} else {
// eslint-disable-next-line no-alert
const fileName = prompt('Filename:');
Expand Down
2 changes: 1 addition & 1 deletion src/graph-builder/graph-core/6-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class GraphServer extends GraphLoadSave {
this.dispatcher({
type: T.SET_FUNCTIONS,
payload: {
built: false, ran: false, debugged: true, cleared: false, stopped: false, destroyed: true,
built: false, ran: true, debugged: true, cleared: false, stopped: false, destroyed: true,
},
});
this.dispatcher({ type: T.SET_LOGS_MESSAGE, payload: this.superState.logsmessage + res.data.output });
Expand Down

0 comments on commit 5cb8005

Please sign in to comment.