mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 06:52:41 +01:00
FIX: Place caching mechanism in a try catch
This commit is contained in:
parent
5a0c72a55a
commit
697cb0f198
1 changed files with 12 additions and 11 deletions
|
@ -129,7 +129,7 @@ export default class SendDetails extends Component {
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
|
this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
|
||||||
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
|
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
|
||||||
|
try {
|
||||||
const cachedNetworkTransactionFees = JSON.parse(await AsyncStorage.getItem(NetworkTransactionFee.StorageKey));
|
const cachedNetworkTransactionFees = JSON.parse(await AsyncStorage.getItem(NetworkTransactionFee.StorageKey));
|
||||||
|
|
||||||
if (cachedNetworkTransactionFees.halfHourFee) {
|
if (cachedNetworkTransactionFees.halfHourFee) {
|
||||||
|
@ -139,9 +139,10 @@ export default class SendDetails extends Component {
|
||||||
feeSliderValue: cachedNetworkTransactionFees.halfHourFee,
|
feeSliderValue: cachedNetworkTransactionFees.halfHourFee,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} catch (_) {}
|
||||||
|
|
||||||
const recommendedFees = await NetworkTransactionFees.recommendedFees();
|
let recommendedFees = await NetworkTransactionFees.recommendedFees();
|
||||||
if (recommendedFees.hasOwnProperty('halfHourFee')) {
|
if (recommendedFees.halfHourFee) {
|
||||||
await AsyncStorage.setItem(NetworkTransactionFee.StorageKey, JSON.stringify(recommendedFees));
|
await AsyncStorage.setItem(NetworkTransactionFee.StorageKey, JSON.stringify(recommendedFees));
|
||||||
this.setState({
|
this.setState({
|
||||||
fee: recommendedFees.halfHourFee,
|
fee: recommendedFees.halfHourFee,
|
||||||
|
|
Loading…
Add table
Reference in a new issue