diff --git a/android/app/build.gradle b/android/app/build.gradle index 6cc589c78..d4297dcea 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -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") diff --git a/android/link-assets-manifest.json b/android/link-assets-manifest.json index 30485b9ae..bf975478a 100644 --- a/android/link-assets-manifest.json +++ b/android/link-assets-manifest.json @@ -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" diff --git a/assets/images/SVG/Error.svg b/assets/images/SVG/Error.svg deleted file mode 100644 index 96f434740..000000000 --- a/assets/images/SVG/Error.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/assets/images/SVG/ErrorIcon.svg b/assets/images/SVG/ErrorIcon.svg index a6ee28d14..90869194f 100644 --- a/assets/images/SVG/ErrorIcon.svg +++ b/assets/images/SVG/ErrorIcon.svg @@ -1,4 +1,4 @@ - + diff --git a/components/OnchainFeeInput.tsx b/components/OnchainFeeInput.tsx index 1ceef6a55..aa378678f 100644 --- a/components/OnchainFeeInput.tsx +++ b/components/OnchainFeeInput.tsx @@ -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'; @@ -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) { @@ -38,6 +39,7 @@ export default function OnchainFeeInput(props: OnchainFeeInputProps) { setLoading(false); }) .catch(() => { + setErrorOccurredLoadingFees(true); setLoading(false); }); } @@ -49,7 +51,12 @@ export default function OnchainFeeInput(props: OnchainFeeInputProps) { NavigationService.navigate('EditFee', { - onNavigateBack: onChangeFee, + onNavigateBack: (fee: string) => { + if (fee) { + setErrorOccurredLoadingFees(false); + } + onChangeFee(fee); + }, fee: newFee }) } @@ -70,12 +77,16 @@ export default function OnchainFeeInput(props: OnchainFeeInputProps) { ) : ( - {newFee} + {errorOccurredLoadingFees + ? localeString('views.EditFee.error') + : newFee} )} diff --git a/ios/link-assets-manifest.json b/ios/link-assets-manifest.json index 30485b9ae..bf975478a 100644 --- a/ios/link-assets-manifest.json +++ b/ios/link-assets-manifest.json @@ -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" diff --git a/ios/zeus.xcodeproj/project.pbxproj b/ios/zeus.xcodeproj/project.pbxproj index cad5f6733..f7290ff99 100644 --- a/ios/zeus.xcodeproj/project.pbxproj +++ b/ios/zeus.xcodeproj/project.pbxproj @@ -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 */; }; @@ -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 = ""; }; DAB0850D6CA542288A565578 /* Success.svg */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Success.svg; path = ../assets/images/SVG/Success.svg; sourceTree = ""; }; 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 = ""; }; - DD470243A7FC45D882EF1B0D /* Error.svg */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Error.svg; path = ../assets/images/SVG/Error.svg; sourceTree = ""; }; DEE698AC647848D9B6DB13F6 /* 3.png */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = 3.png; path = ../assets/images/intro/3.png; sourceTree = ""; }; DFA342136699448EA20DE82D /* Sync.svg */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Sync.svg; path = ../assets/images/SVG/Sync.svg; sourceTree = ""; }; 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 = ""; }; @@ -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 */, @@ -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 */, diff --git a/stores/FeeStore.ts b/stores/FeeStore.ts index efa90a032..81c86212a 100644 --- a/stores/FeeStore.ts +++ b/stores/FeeStore.ts @@ -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; }); }; diff --git a/views/EditFee.tsx b/views/EditFee.tsx index 9c52bc2e8..3475a75be 100644 --- a/views/EditFee.tsx +++ b/views/EditFee.tsx @@ -8,7 +8,8 @@ import { TextInput, View, TouchableOpacity, - TouchableWithoutFeedback + TouchableWithoutFeedback, + Keyboard } from 'react-native'; import { inject, observer } from 'mobx-react'; @@ -63,7 +64,7 @@ export default class EditFee extends React.Component< const preferredMempoolRate = settings?.payments?.preferredMempoolRate || 'fastestFee'; - if (fee && fees[preferredMempoolRate] === fee) { + if (fee && fees?.[preferredMempoolRate] === fee) { this.setState({ selectedFee: preferredMempoolRate, fee @@ -72,7 +73,7 @@ export default class EditFee extends React.Component< } render() { - const { selectedFee } = this.state; + const { selectedFee, fee, customFee } = this.state; const { navigation, FeeStore } = this.props; const displayOnly = navigation.getParam('displayOnly', null); const { recommendedFees, loading, error, getOnchainFeesviaMempool } = @@ -101,7 +102,7 @@ export default class EditFee extends React.Component< : localeString('views.EditFee.title'), style: { color: themeColor('text') } }} - rightComponent={ReloadButton} + rightComponent={ReloadButton()} navigation={navigation} /> - {loading && !error && ( + {loading && ( - + )} {recommendedFees['fastestFee'] && !loading && ( @@ -136,14 +137,15 @@ export default class EditFee extends React.Component< }} > + onPress={() => { this.setState({ selectedFee: 'fastestFee', fee: recommendedFees[ 'fastestFee' ].toString() - }) - } + }); + Keyboard.dismiss(); + }} > + onPress={() => { this.setState({ selectedFee: 'halfHourFee', fee: recommendedFees[ 'halfHourFee' ].toString() - }) - } + }); + Keyboard.dismiss(); + }} > - + onPress={() => { this.setState({ selectedFee: 'hourFee', fee: recommendedFees[ 'hourFee' ].toString() - }) - } + }); + Keyboard.dismiss(); + }} > + onPress={() => { this.setState({ selectedFee: 'minimumFee', fee: recommendedFees[ 'minimumFee' ].toString() - }) - } + }); + Keyboard.dismiss(); + }} > - - {!displayOnly && ( - <> - - {localeString( - 'views.EditFee.custom' - )} - - - - this.setState({ - customFee: text, - fee: text, - selectedFee: 'custom' - }) - } - onFocus={() => - this.setState({ - selectedFee: 'custom' - }) - } - > - - - - - - )} )} {error && !loading && ( - + {localeString('views.EditFee.error')} )} + {!displayOnly && !loading && ( + + + {localeString('views.EditFee.custom')} + + + { + text = text.replace(/[^0-9]*/g, ''); + this.setState({ + customFee: text, + fee: text, + selectedFee: 'custom' + }); + }} + onFocus={() => + this.setState({ + selectedFee: 'custom' + }) + } + /> + + + + + + )} diff --git a/views/SendingLightning.tsx b/views/SendingLightning.tsx index 37f65539d..319107203 100644 --- a/views/SendingLightning.tsx +++ b/views/SendingLightning.tsx @@ -25,7 +25,7 @@ import { localeString } from '../utils/LocaleUtils'; import { themeColor } from '../utils/ThemeUtils'; import Clock from '../assets/images/SVG/Clock.svg'; -import Error from '../assets/images/SVG/Error.svg'; +import ErrorIcon from '../assets/images/SVG/ErrorIcon.svg'; import Wordmark from '../assets/images/SVG/wordmark-black.svg'; import CopyBox from '../components/CopyBox'; @@ -263,13 +263,13 @@ export default class SendingLightning extends React.Component< {(!!error || !!payment_error) && !LnurlPayStore.isZaplocker && ( - -