Skip to content

Commit

Permalink
Fix issue where malformed line would appear in bulk export
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Brindamour committed May 5, 2017
1 parent e529f5c commit 9d20a6d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions calc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var Calc = React.createClass({

calculate: function() {

var inputs = _.map(_.union([this.state.input], this.state.additionalInputs), function(input) {
var inputs = _.map(this.getInputs(), function(input) {
return {recipe: input.recipe, ips: input.ipm / 60};
});
var result = Calculator.calculateAndAnalyze(inputs, this.state.options);
Expand Down Expand Up @@ -141,10 +141,20 @@ var Calc = React.createClass({
<h2>Layout</h2>
<Graph req={this.state.result} />
<Explain recipe={this.state.explainingRecipe} options={this.state.options} onRequestClose={this.stopExplain} />
<Bulk bulkVisible={this.state.bulkVisible} inputs={ _.union([this.state.input], this.state.additionalInputs)} onRequestClose={this.hideBulk} onImport={this.bulkImport} />
<Bulk bulkVisible={this.state.bulkVisible} inputs={ this.getInputs() } onRequestClose={this.hideBulk} onImport={this.bulkImport} />
</div>
);
},

getInputs: function() {
if (this.state.input.recipe) {
return _.union([this.state.input], this.state.additionalInputs);
} else {
return this.state.additionalInputs;
}
}


});


Expand Down

0 comments on commit 9d20a6d

Please sign in to comment.