FIX: Restored deep link.

This commit is contained in:
Marcos Rodriguez Vélez 2018-12-23 13:18:27 -05:00
parent c1b70cb537
commit 2901f80c32
4 changed files with 25 additions and 4 deletions

View File

@ -36,7 +36,12 @@ export class AbstractWallet {
}
getPreferredBalanceUnit() {
return this.preferredBalanceUnit || BitcoinUnit.BTC;
for (let value of Object.values(BitcoinUnit)) {
if (value === this.preferredBalanceUnit) {
return this.preferredBalanceUnit;
}
}
return BitcoinUnit.BTC;
}
allowReceive() {

View File

@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>164</string>
<string>165</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View File

@ -135,8 +135,25 @@ export default class SendDetails extends Component {
});
if (this.props.navigation.state.params.uri) {
if (!BitcoinBIP70TransactionDecode.matchesPaymentURL(this.props.navigation.state.params.uri)) {
if (BitcoinBIP70TransactionDecode.matchesPaymentURL(this.props.navigation.state.params.uri)) {
this.processBIP70Invoice(this.props.navigation.state.params.uri);
} else {
try {
let amount = '';
let parsedBitcoinUri = null;
let address = '';
let memo = '';
parsedBitcoinUri = bip21.decode(this.props.navigation.state.params.uri);
console.warn(parsedBitcoinUri);
address = parsedBitcoinUri.address || address;
amount = parsedBitcoinUri.options.amount.toString() || amount;
memo = parsedBitcoinUri.options.label || memo;
this.setState({ address, amount, memo });
} catch (error) {
console.log(error);
alert('Error: Unable to decode Bitcoin address');
}
}
}
}

View File

@ -18,7 +18,6 @@ import { NavigationEvents } from 'react-navigation';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import PropTypes from 'prop-types';
import { BitcoinUnit } from '../../models/bitcoinUnits';
const BigNumber = require('bignumber.js');
let EV = require('../../events');
let A = require('../../analytics');
/** @type {AppStorage} */