mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 23:08:07 +01:00
FIX: set default fee in CPFP/RBF fee-selection component
This commit is contained in:
parent
e9df2e5149
commit
a4197fbfd5
2 changed files with 18 additions and 17 deletions
|
@ -2292,7 +2292,6 @@ export class BlueReplaceFeeSuggestions extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
selectedFeeType: NetworkTransactionFeeType.FAST,
|
|
||||||
customFeeValue: '1',
|
customFeeValue: '1',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2301,11 +2300,11 @@ export class BlueReplaceFeeSuggestions extends Component {
|
||||||
const cachedNetworkTransactionFees = JSON.parse(await AsyncStorage.getItem(NetworkTransactionFee.StorageKey));
|
const cachedNetworkTransactionFees = JSON.parse(await AsyncStorage.getItem(NetworkTransactionFee.StorageKey));
|
||||||
|
|
||||||
if (cachedNetworkTransactionFees && 'fastestFee' in cachedNetworkTransactionFees) {
|
if (cachedNetworkTransactionFees && 'fastestFee' in cachedNetworkTransactionFees) {
|
||||||
this.setState({ networkFees: cachedNetworkTransactionFees });
|
this.setState({ networkFees: cachedNetworkTransactionFees }, () => this.onFeeSelected(NetworkTransactionFeeType.FAST));
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
const networkFees = await NetworkTransactionFees.recommendedFees();
|
const networkFees = await NetworkTransactionFees.recommendedFees();
|
||||||
this.setState({ networkFees });
|
this.setState({ networkFees }, () => this.onFeeSelected(NetworkTransactionFeeType.FAST));
|
||||||
}
|
}
|
||||||
|
|
||||||
onFeeSelected = selectedFeeType => {
|
onFeeSelected = selectedFeeType => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* global alert */
|
/* global alert */
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { ActivityIndicator, View, TextInput, TouchableOpacity, Linking, ScrollView, StyleSheet } from 'react-native';
|
import { ActivityIndicator, View, TextInput, TouchableOpacity, Linking, ScrollView, StyleSheet, KeyboardAvoidingView } from 'react-native';
|
||||||
import Clipboard from '@react-native-community/clipboard';
|
import Clipboard from '@react-native-community/clipboard';
|
||||||
import { Text } from 'react-native-elements';
|
import { Text } from 'react-native-elements';
|
||||||
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
|
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
|
||||||
|
@ -167,20 +167,22 @@ export default class CPFP extends Component {
|
||||||
|
|
||||||
renderStage1(text) {
|
renderStage1(text) {
|
||||||
return (
|
return (
|
||||||
<SafeBlueArea style={styles.root}>
|
<KeyboardAvoidingView behavior="position">
|
||||||
<BlueSpacing />
|
<SafeBlueArea style={styles.root}>
|
||||||
<BlueCard style={styles.center}>
|
|
||||||
<BlueText>{text}</BlueText>
|
|
||||||
<BlueSpacing20 />
|
|
||||||
<BlueReplaceFeeSuggestions onFeeSelected={fee => this.setState({ newFeeRate: fee })} transactionMinimum={this.state.feeRate} />
|
|
||||||
<BlueSpacing />
|
<BlueSpacing />
|
||||||
<BlueButton
|
<BlueCard style={styles.center}>
|
||||||
disabled={this.state.newFeeRate <= this.state.feeRate}
|
<BlueText>{text}</BlueText>
|
||||||
onPress={() => this.createTransaction()}
|
<BlueSpacing20 />
|
||||||
title={loc.transactions.cpfp_create}
|
<BlueReplaceFeeSuggestions onFeeSelected={fee => this.setState({ newFeeRate: fee })} transactionMinimum={this.state.feeRate} />
|
||||||
/>
|
<BlueSpacing />
|
||||||
</BlueCard>
|
<BlueButton
|
||||||
</SafeBlueArea>
|
disabled={this.state.newFeeRate <= this.state.feeRate}
|
||||||
|
onPress={() => this.createTransaction()}
|
||||||
|
title={loc.transactions.cpfp_create}
|
||||||
|
/>
|
||||||
|
</BlueCard>
|
||||||
|
</SafeBlueArea>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue