Skip to content

Commit

Permalink
Merge pull request #31 from gabrielwr/fix-one-off-#28
Browse files Browse the repository at this point in the history
Fix one off #22
  • Loading branch information
gabrielwr authored Aug 6, 2017
2 parents 2f3b021 + f7294d4 commit 0b76fc0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions client/components/Calculator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ export default class Calculator extends React.Component {

for(let i = 0; i <= yearsLeft; i++) {
accumulatedSavings += Math.floor((accumulatedSavings/100) * state.marketReturn)
graphData.push({
savings: accumulatedSavings,
age: `${currentAge++}`,
})
if(i >= yearsToRetirement && !retiredBool) {
retiredBool = true;
this.props.addRetireAmt(`${accumulatedSavings}`)
Expand All @@ -58,17 +54,21 @@ export default class Calculator extends React.Component {
} else {
accumulatedSavings -= retireSpending;
}
graphData.push({
savings: accumulatedSavings,
age: `${currentAge++}`,
})
}

//dispatch to store
this.props.addGraph(graphData)
this.props.addFinalAmt(`${accumulatedSavings}`)
this.props.addGraph(graphData)
}

handleCurrentAge(evt, age) {
if(age >= +this.props.retireAge) {
// console.error(`age can't be greater than retire age`)
this.props.addRetireAge(`{age + 1}`)
this.props.addRetireAge(`${age + 1}`)
}
this.props.addCurrentAge(`${age}`)
this.computeData()
Expand Down
2 changes: 1 addition & 1 deletion client/public/bundle.js.map

Large diffs are not rendered by default.

0 comments on commit 0b76fc0

Please sign in to comment.