Skip to content

Commit

Permalink
Merge pull request #2661 from blockchain/feat/FWLT-682-handle-QR-scan
Browse files Browse the repository at this point in the history
feat(qr scan): improved way of scanning coinbase QR from ETH
  • Loading branch information
schnogz committed Sep 15, 2020
2 parents f06e585 + e5a6698 commit 0f0fb54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ class QRCodeCaptureContainer extends React.PureComponent {
}
}

handleScanEthAddress (data) {
handleScanEthAddress (inputAddress) {
const data = utils.eth.sanitazeEth(inputAddress)
if (utils.eth.isValidAddress(data)) {
this.props.formActions.change(ETH_FORM, 'to', this.createNewValue(data))
} else {
Expand Down
2 changes: 2 additions & 0 deletions packages/blockchain-wallet-v4/src/utils/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,5 @@ export const convertFeeToWei = fees => ({
max: convertGweiToWei(path(['limits', 'max'], fees))
}
})

export const sanitazeEth = (data: string) => data.replace(/.*:/, '')

0 comments on commit 0f0fb54

Please sign in to comment.