Skip to content

Commit

Permalink
Merge pull request #2173 from myxmaster/allow_custom_fee_if_mempool_A…
Browse files Browse the repository at this point in the history
…PI_unfunctional

Allow entering custom fee if loading fees from mempool fails
  • Loading branch information
kaloudis authored May 10, 2024
2 parents 55c0974 + dfbd014 commit d9e9e5b
Show file tree
Hide file tree
Showing 11 changed files with 128 additions and 124 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ dependencies {
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01'
implementation files("../../node_modules/react-native-tor/android/libs/sifir_android.aar")
// gif
implementation 'com.facebook.fresco:fresco:2.6.0'
implementation 'com.facebook.fresco:animated-gif:2.6.0'
implementation 'com.facebook.fresco:fresco:3.1.3'
implementation 'com.facebook.fresco:animated-gif:3.1.3'

// Pegasus
// implementation(name:"Lndmobile", ext:"aar")
Expand Down
4 changes: 0 additions & 4 deletions android/link-assets-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@
"path": "assets/images/SVG/Edit.svg",
"sha1": "1f6acf36aa5a17040c73377b528ed5b953a48850"
},
{
"path": "assets/images/SVG/Error.svg",
"sha1": "1bf7ab74cc3be1adca93c821e0c577374a2238de"
},
{
"path": "assets/images/SVG/ErrorIcon.svg",
"sha1": "05da1a652815c751b35361d0433742894988be0a"
Expand Down
5 changes: 0 additions & 5 deletions assets/images/SVG/Error.svg

This file was deleted.

2 changes: 1 addition & 1 deletion assets/images/SVG/ErrorIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 17 additions & 6 deletions components/OnchainFeeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import { Text, TouchableWithoutFeedback, View } from 'react-native';
import TextInput from '../components/TextInput';
import { themeColor } from '../utils/ThemeUtils';
import { localeString } from '../utils/LocaleUtils';
import stores from '../stores/Stores';
import NavigationService from '../NavigationService';
import LoadingIndicator from './LoadingIndicator';
Expand All @@ -22,10 +23,10 @@ export default function OnchainFeeInput(props: OnchainFeeInputProps) {

const [newFee, setNewFee] = useState(fee);
const [loading, setLoading] = useState(false);
const [errorOccurredLoadingFees, setErrorOccurredLoadingFees] =
useState(false);

useEffect(() => {
setNewFee(fee);
}, [fee]);
useEffect(() => setNewFee(fee), [fee]);

useEffect(() => {
if (enableMempoolRates) {
Expand All @@ -38,6 +39,7 @@ export default function OnchainFeeInput(props: OnchainFeeInputProps) {
setLoading(false);
})
.catch(() => {
setErrorOccurredLoadingFees(true);
setLoading(false);
});
}
Expand All @@ -49,7 +51,12 @@ export default function OnchainFeeInput(props: OnchainFeeInputProps) {
<TouchableWithoutFeedback
onPress={() =>
NavigationService.navigate('EditFee', {
onNavigateBack: onChangeFee,
onNavigateBack: (fee: string) => {
if (fee) {
setErrorOccurredLoadingFees(false);
}
onChangeFee(fee);
},
fee: newFee
})
}
Expand All @@ -70,12 +77,16 @@ export default function OnchainFeeInput(props: OnchainFeeInputProps) {
) : (
<Text
style={{
color: themeColor('text'),
color: errorOccurredLoadingFees
? themeColor('warning')
: themeColor('text'),
paddingLeft: 15,
fontSize: 18
}}
>
{newFee}
{errorOccurredLoadingFees
? localeString('views.EditFee.error')
: newFee}
</Text>
)}
</View>
Expand Down
4 changes: 0 additions & 4 deletions ios/link-assets-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@
"path": "assets/images/SVG/Edit.svg",
"sha1": "1f6acf36aa5a17040c73377b528ed5b953a48850"
},
{
"path": "assets/images/SVG/Error.svg",
"sha1": "1bf7ab74cc3be1adca93c821e0c577374a2238de"
},
{
"path": "assets/images/SVG/ErrorIcon.svg",
"sha1": "05da1a652815c751b35361d0433742894988be0a"
Expand Down
4 changes: 0 additions & 4 deletions ios/zeus.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@
E493C650358D49E193BC19D8 /* PinHollow.svg in Resources */ = {isa = PBXBuildFile; fileRef = AA4B9185A0E64EC68F5F0628 /* PinHollow.svg */; };
E691022067D14B198BFF83DB /* Dice.svg in Resources */ = {isa = PBXBuildFile; fileRef = CE4931FF962B4189AC3F3EEB /* Dice.svg */; };
ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; };
EE7264005C294AE58E30C834 /* Error.svg in Resources */ = {isa = PBXBuildFile; fileRef = DD470243A7FC45D882EF1B0D /* Error.svg */; };
F15BCD255F194C84973AB51D /* Skull.svg in Resources */ = {isa = PBXBuildFile; fileRef = B813A99762CC4756A18E0C20 /* Skull.svg */; };
F6BA97FE98FB4D8890855BEC /* Wallet.svg in Resources */ = {isa = PBXBuildFile; fileRef = CCFEAC399BB842A091ADB042 /* Wallet.svg */; };
F9767258AD2F4256A0668218 /* Save.svg in Resources */ = {isa = PBXBuildFile; fileRef = 6934A0BCDAD94002BA8F840A /* Save.svg */; };
Expand Down Expand Up @@ -502,7 +501,6 @@
D7E370054BBF42359E7A5112 /* Wallet2.svg */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Wallet2.svg; path = ../assets/images/SVG/Wallet2.svg; sourceTree = "<group>"; };
DAB0850D6CA542288A565578 /* Success.svg */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Success.svg; path = ../assets/images/SVG/Success.svg; sourceTree = "<group>"; };
DD1A9F0B9EF0475C81C53C8D /* Flash On.svg */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Flash On.svg"; path = "../assets/images/SVG/Flash On.svg"; sourceTree = "<group>"; };
DD470243A7FC45D882EF1B0D /* Error.svg */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Error.svg; path = ../assets/images/SVG/Error.svg; sourceTree = "<group>"; };
DEE698AC647848D9B6DB13F6 /* 3.png */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = 3.png; path = ../assets/images/intro/3.png; sourceTree = "<group>"; };
DFA342136699448EA20DE82D /* Sync.svg */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Sync.svg; path = ../assets/images/SVG/Sync.svg; sourceTree = "<group>"; };
E21D3D5587114764BC296D83 /* Key Security.svg */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Key Security.svg"; path = "../assets/images/SVG/Key Security.svg"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -927,7 +925,6 @@
AC3DB90B22364D909A09B3E0 /* ScanFrameSvg.tsx */,
C7FBAA85E56C4D5D92F74F11 /* UnifiedSvg.tsx */,
3C817E9DD0504569B85A84F1 /* Edit.svg */,
DD470243A7FC45D882EF1B0D /* Error.svg */,
B4C39762C9B748E39BFDA90F /* ExchangeBitcoin.svg */,
6C81853A9EA0452B9999E58D /* ExchangeFiat.svg */,
4A6B733324794E60B618DACE /* Export.svg */,
Expand Down Expand Up @@ -1387,7 +1384,6 @@
4132F00F76CB488AAA77C848 /* ScanFrameSvg.tsx in Resources */,
7598B75F1F64426CAF420155 /* UnifiedSvg.tsx in Resources */,
5851F5898AED446FA5EF41FB /* Edit.svg in Resources */,
EE7264005C294AE58E30C834 /* Error.svg in Resources */,
6027AA29AEA34E7290034736 /* ExchangeBitcoin.svg in Resources */,
93C795DB3CDC46D8862C3393 /* ExchangeFiat.svg in Resources */,
1E2D6C276B2449BEB48D0EFA /* Export.svg in Resources */,
Expand Down
4 changes: 3 additions & 1 deletion stores/FeeStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ export default class FeeStore {
this.error = true;
}
})
.catch(() => {
.catch((error: any) => {
console.error('Error fetching fees:', error);
this.recommendedFees = {};
this.loading = false;
this.error = true;
});
};

Expand Down
Loading

0 comments on commit d9e9e5b

Please sign in to comment.