Skip to content

Commit

Permalink
Merge pull request #2 from michaeltout/master
Browse files Browse the repository at this point in the history
Fix Agama QR Code reading and change version numbers
  • Loading branch information
michaeltout authored Feb 24, 2019
2 parents 59f0845 + b5f5034 commit c321d30
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "verusmobile",
"version": "0.1.1-beta",
"version": "0.1.2-beta",
"private": true,
"scripts": {
"start": "meteor run",
Expand Down
20 changes: 19 additions & 1 deletion src/containers/VerusPay.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from '../actions/actionCreators'
import Spinner from 'react-native-loading-spinner-overlay';
import AlertAsync from "react-native-alert-async";
import { coinsToSats } from '../utils/math'

const FORMAT_UNKNOWN = "QR Data format unrecognized"
const ADDRESS_ONLY = "Only address detected, please fill out amount field"
Expand Down Expand Up @@ -72,6 +73,17 @@ class VerusPay extends Component {
this.handleVerusQR(resultParsed)
} else {
//TODO: Handle other style QR codes here
if (resultParsed.address && resultParsed.amount && resultParsed.coin) {
let resultConverted = {
coinTicker: resultParsed.coin,
amount: coinsToSats(resultParsed.amount),
address: resultParsed.address
}

this.handleVerusQR(resultConverted)
} else {
this.errorHandler(FORMAT_UNKNOWN)
}
}
} else {
if (result.length < 34 || result.length > 35 ) {
Expand Down Expand Up @@ -102,7 +114,13 @@ class VerusPay extends Component {
console.log("Amount: " + amount)
console.log("Memo: " + memo)

if (coinTicker && address && amount && address.length >= 34 && address.length <= 35) {
if (
coinTicker &&
address &&
amount &&
address.length >= 34 &&
address.length <= 35 &&
amount > 0) {
if (this.coinExistsInWallet(coinTicker)) {
let activeCoin = this.getCoinFromActiveCoins(coinTicker)

Expand Down

0 comments on commit c321d30

Please sign in to comment.