Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit

Permalink
fix: cache only valid input amount (#162)
Browse files Browse the repository at this point in the history
* refactor: dont cache user input

* refactor: only cache user input if valid

* chore: lint
  • Loading branch information
ImmanuelSegol authored and michael1011 committed Apr 17, 2019
1 parent 2aaee10 commit 5dd03fb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/swaptab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ class SwapTab extends React.Component {
componentDidMount = () => {
const symbol = this.getSymbol();
const limits = this.props.limits[symbol];

this.setState(
{
minAmount: limits.minimal,
Expand Down Expand Up @@ -251,9 +250,11 @@ class SwapTab extends React.Component {
});
}

localStorage.setItem('base', base);
localStorage.setItem('quote', quote);
localStorage.setItem('baseAmount', baseAmount);
if (!this.state.inputError) {
localStorage.setItem('base', base);
localStorage.setItem('quote', quote);
localStorage.setItem('baseAmount', baseAmount);
}
};

calculateMinerFee = () => {
Expand Down

0 comments on commit 5dd03fb

Please sign in to comment.