diff --git a/android/app/build.gradle b/android/app/build.gradle index bdebefbd94..3e6e13ed28 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -172,8 +172,8 @@ android { applicationId "com.bitpay.wallet" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 91212452 - versionName "14.48.0" + versionCode 91212454 + versionName "14.48.2" missingDimensionStrategy 'react-native-camera', 'mlkit' // A perf build allows screenshots (no FLAG_SECURE) and is profileable, so // it must never be signed with the Play upload key: refuse the build if diff --git a/ios/BitPayApp/Info.plist b/ios/BitPayApp/Info.plist index c93da1c34c..6ce1dcd904 100644 --- a/ios/BitPayApp/Info.plist +++ b/ios/BitPayApp/Info.plist @@ -26,7 +26,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 14.48.0 + 14.48.2 CFBundleSignature ???? CFBundleURLTypes diff --git a/package.json b/package.json index 2d0ff4ac5b..97cdad8292 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitpay", - "version": "14.48.0", + "version": "14.48.2", "private": true, "engines": { "node": "^22.13.0 || ^24.3.0 || >=26.0.0" diff --git a/src/navigation/wallet/screens/AmountScreen.tsx b/src/navigation/wallet/screens/AmountScreen.tsx index d8dcd0800b..027580b8b6 100644 --- a/src/navigation/wallet/screens/AmountScreen.tsx +++ b/src/navigation/wallet/screens/AmountScreen.tsx @@ -96,9 +96,16 @@ const AmountScreen: React.FC< NativeStackScreenProps > = ({navigation, route}) => { const {t} = useTranslation(); - const [buttonState, setButtonState] = useState(); + const [buttonState, setButtonStateValue] = useState(); const [showWalletOptions, setShowWalletOptions] = useState(false); const [isSendMax, setIsSendMax] = useState(false); + // A failed submit also clears send-max, so the button is usable again. + const setButtonState = useCallback((state: ButtonState) => { + setButtonStateValue(state); + if (state === 'failed') { + setIsSendMax(false); + } + }, []); const { wallet, @@ -123,12 +130,6 @@ const AmountScreen: React.FC< onSendMaxPressedRef.current = onSendMaxPressed; }); - useEffect(() => { - if (buttonState === 'failed') { - setIsSendMax(false); - } - }, [buttonState]); - useEffect( () => navigation.addListener('focus', () => setIsSendMax(false)), [navigation], diff --git a/src/navigation/wallet/screens/send/GlobalSendTo.tsx b/src/navigation/wallet/screens/send/GlobalSendTo.tsx index 40ad56ac3d..491b2465a6 100644 --- a/src/navigation/wallet/screens/send/GlobalSendTo.tsx +++ b/src/navigation/wallet/screens/send/GlobalSendTo.tsx @@ -1,4 +1,11 @@ -import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; +import React, { + useCallback, + useEffect, + useLayoutEffect, + useMemo, + useRef, + useState, +} from 'react'; import {SafeAreaView, ScrollView, StyleSheet, View} from 'react-native'; import { RouteProp, @@ -90,7 +97,9 @@ const GlobalSendTo = () => { }; const goToRecipientRef = useRef(goToRecipient); - goToRecipientRef.current = goToRecipient; + useLayoutEffect(() => { + goToRecipientRef.current = goToRecipient; + }); const debouncedValidateSearchInput = useDebouncedSendToValidation(text => { const data = text.trim();