mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-23 15:20:55 +01:00
FIX: pass local fiat currency to buy-bitcoin widget
This commit is contained in:
parent
de642f60be
commit
2a90b271c2
1 changed files with 10 additions and 0 deletions
|
@ -3,6 +3,7 @@ import { BlueNavigationStyle, BlueLoading } from '../../BlueComponents';
|
|||
import PropTypes from 'prop-types';
|
||||
import { WebView } from 'react-native-webview';
|
||||
import { AppStorage, LightningCustodianWallet, WatchOnlyWallet } from '../../class';
|
||||
const currency = require('../../currency');
|
||||
let BlueApp: AppStorage = require('../../BlueApp');
|
||||
let loc = require('../../loc');
|
||||
|
||||
|
@ -27,6 +28,9 @@ export default class BuyBitcoin extends Component {
|
|||
async componentDidMount() {
|
||||
console.log('buyBitcoin - componentDidMount');
|
||||
|
||||
let preferredCurrency = await currency.getPreferredCurrency();
|
||||
preferredCurrency = preferredCurrency.endPointKey;
|
||||
|
||||
/** @type {AbstractHDWallet|WatchOnlyWallet|LightningCustodianWallet} */
|
||||
let wallet = this.state.wallet;
|
||||
|
||||
|
@ -38,6 +42,7 @@ export default class BuyBitcoin extends Component {
|
|||
this.setState({
|
||||
isLoading: false,
|
||||
address,
|
||||
preferredCurrency,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -62,6 +67,7 @@ export default class BuyBitcoin extends Component {
|
|||
this.setState({
|
||||
isLoading: false,
|
||||
address,
|
||||
preferredCurrency,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -78,6 +84,10 @@ export default class BuyBitcoin extends Component {
|
|||
uri += '&safelloStateToken=' + safelloStateToken;
|
||||
}
|
||||
|
||||
if (this.state.preferredCurrency) {
|
||||
uri += '¤cy=' + this.state.preferredCurrency;
|
||||
}
|
||||
|
||||
return (
|
||||
<WebView
|
||||
source={{
|
||||
|
|
Loading…
Add table
Reference in a new issue