Merge pull request #7094 from BlueWallet/fees

FIX: Unit switch within Send screen
This commit is contained in:
GLaDOS 2024-09-20 09:44:47 +00:00 committed by GitHub
commit 1c2ff4679d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ interface SelectFeeModalProps {
}
const SelectFeeModal = forwardRef<BottomModalHandle, SelectFeeModalProps>(
({ networkTransactionFees, feePrecalc, feeRate, setCustomFee, setFeePrecalc, feeUnit }, ref) => {
({ networkTransactionFees, feePrecalc, feeRate, setCustomFee, setFeePrecalc, feeUnit = BitcoinUnit.BTC }, ref) => {
const [customFee, setCustomFeeState] = useState('');
const feeModalRef = useRef<BottomModalHandle>(null);
const customModalRef = useRef<BottomModalHandle>(null);
@ -139,7 +139,7 @@ const SelectFeeModal = forwardRef<BottomModalHandle, SelectFeeModalProps>(
},
];
const formatFee = (fee: number) => formatBalance(fee, feeUnit!, true);
const formatFee = (fee: number) => formatBalance(fee, feeUnit, true);
const handleCustomFeeSubmit = async () => {
if (!/^\d+$/.test(customFee) || Number(customFee) <= 0) {

View File

@ -1371,7 +1371,7 @@ const SendDetails = () => {
feeRate={feeRate}
setCustomFee={setCustomFee}
setFeePrecalc={setFeePrecalc}
feeUnit={feeUnit || BitcoinUnit.BTC}
feeUnit={units[scrollIndex.current]}
/>
</View>
<DismissKeyboardInputAccessory />