Skip to content

Commit

Permalink
fix(Simput): Fix serialization/deserialization issue with simput model
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Mar 9, 2016
1 parent 5a5c37b commit 8ac4661
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/workflows/pyfr/components/steps/Input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,15 @@ export default React.createClass({
metadata: { model: JSON.stringify(jsonData) },
}).then((resp) => {
var newSim = deepClone(this.props.simulation);
newSim.steps[this.props.step].metadata.model = jsonData;
newSim.steps[this.props.step].metadata.model = JSON.stringify(jsonData);
client.invalidateSimulation(newSim);
});
} else {
jsonData = JSON.parse(jsonData);
if (typeof jsonData === 'string') {
jsonData = JSON.parse(jsonData);
} else {
console.log('Can not convert jsonData (?)', jsonData);
}
}

// Push model to state
Expand All @@ -116,7 +120,7 @@ export default React.createClass({
metadata: { model: JSON.stringify(jsonData) },
}).then((resp) => {
var newSim = deepClone(this.props.simulation);
newSim.steps[this.props.step].metadata.model = jsonData;
newSim.steps[this.props.step].metadata.model = JSON.stringify(jsonData);
client.invalidateSimulation(newSim);
});

Expand Down

0 comments on commit 8ac4661

Please sign in to comment.