Open mattb555 opened 5 years ago
Thank you very much, I must have missed this PR, sorry for the delay getting back to you.
I'll pull this down this evening and take a look.
A HOC sounds like a good idea or it could probably do with a small Redux store.
What I Did Do:
Made it so that clicking on "Graph Editor" while in a saved model causes the graph information to de-render and a prompt asking for save to render in its place.
Made it so that regardless of answer to prompt, the newly rendered graph information is blank.
Moved the save node logic up into index.js out of graph-builder.js to allow for rendering of previously specified prompt.
What I Did Not Do:
Clicking "Graph Editor" while in a model that hasn't been saved yet does not cause the graph information to reset or a save prompt to appear. This is because the logic tied to the rendering of the save prompt is dependent on props changing, and the already existing save node logic depends on the model being saved in the first place.
Recommendation
Clicking Model List does not prompt for save. This is because at the moment the highest level of parent child relationship supporting the save functionality is index.js inside the graph-editor folder, which basically means that save functionality is tied to the graph editor itself, so routing away from the graph editor routes away from save functionality.
Recommendation