Skip to content

Commit

Permalink
Merge pull request #152 from leapdao/fix/message-no-reloading
Browse files Browse the repository at this point in the history
Make message optional in Request
  • Loading branch information
TimDaub committed Jun 7, 2019
2 parents a2c3810 + bac97e5 commit 497a2ae
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/SendByScan.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,15 @@ class SendByScan extends Component {
console.log("RETURN STATE:",this.props.returnState)
let returnState = this.props.parseAndCleanPath(dataAfterColon)
this.props.returnToState(returnState)
} else if(Web3.utils.isAddress(dataSplit[0]) && !isNaN(parseInt(dataSplit[1], 10)) && dataSplit[2]) {
// NOTE: We only need the address and the amount as absolutely necessary
// parts of the QR code scan. `message` is optional.
} else if(Web3.utils.isAddress(dataSplit[0]) && !isNaN(parseInt(dataSplit[1], 10))) {
const returnState = {
toAddress: dataSplit[0],
amount: parseInt(dataSplit[1], 10),
message: dataSplit[2]
amount: parseInt(dataSplit[1], 10)
}
if (dataSplit.length > 1) {
returnState.message = dataSplit[2]
}
this.props.returnToState(returnState);
} else {
Expand Down

0 comments on commit 497a2ae

Please sign in to comment.