Merge pull request #3343 from BlueWallet/scrollbug

FIX: Scanning for a batch tx woud reset contentOffset
This commit is contained in:
GLaDOS 2021-07-05 18:56:26 +01:00 committed by GitHub
commit 1c8ef2d806
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View file

@ -349,7 +349,7 @@ PODS:
- React-Core (= 0.63.4)
- React-cxxreact (= 0.63.4)
- React-jsi (= 0.63.4)
- RealmJS (10.4.1):
- RealmJS (10.4.2):
- GCDWebServer
- React
- RemobileReactNativeQrcodeLocalImage (1.0.4):
@ -700,7 +700,7 @@ SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
BVLinearGradient: e3aad03778a456d77928f594a649e96995f1c872
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: cde416483dac037923206447da6e1454df403714
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e
FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e
Flipper: 1bd2db48dcc31e4b167b9a33ec1df01c2ded4893
@ -712,7 +712,7 @@ SPEC CHECKSUMS:
FlipperKit: 651f50a42eb95c01b3e89a60996dd6aded529eeb
Folly: b73c3869541e86821df3c387eb0af5f65addfab4
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
lottie-ios: 3a3758ef5a008e762faec9c9d50a39842f26d124
lottie-react-native: 4dff8fe8d10ddef9e7880e770080f4a56121397e
@ -751,7 +751,7 @@ SPEC CHECKSUMS:
React-RCTText: 5c51df3f08cb9dedc6e790161195d12bac06101c
React-RCTVibration: ae4f914cfe8de7d4de95ae1ea6cc8f6315d73d9d
ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b
RealmJS: 8a51eff2b9eaabf78b53a6819da6da6edde27467
RealmJS: 90f2a558fdda19ebb9fcbc0a52c7b1d1b049fb88
RemobileReactNativeQrcodeLocalImage: 57aadc12896b148fb5e04bc7c6805f3565f5c3fa
RNCAsyncStorage: 8324611026e8dc3706f829953aa6e3899f581589
RNCClipboard: dac13db8b1ce9b998f1cbc7ca33440113602847f

View file

@ -76,7 +76,6 @@ const SendDetails = () => {
const [payjoinUrl, setPayjoinUrl] = useState(null);
const [changeAddress, setChangeAddress] = useState();
const [dumb, setDumb] = useState(false);
// if cutomFee is not set, we need to choose highest possible fee for wallet balance
// if there are no funds for even Slow option, use 1 sat/byte fee
const feeRate = useMemo(() => {
@ -326,6 +325,7 @@ const SendDetails = () => {
* @param data {String} Can be address or `bitcoin:xxxxxxx` uri scheme, or invalid garbage
*/
const processAddressData = data => {
const currentIndex = scrollIndex.current;
setIsLoading(true);
if (!data.replace) {
// user probably scanned PSBT and got an object instead of string..?
@ -340,6 +340,8 @@ const SendDetails = () => {
return [...addresses];
});
setIsLoading(false);
// RN Bug: contentOffset gets reset to 0 when state changes. Remove code once this bug is resolved.
setTimeout(() => scrollView.current.scrollToIndex({ index: currentIndex, animated: false }), 50);
return;
}
@ -373,6 +375,8 @@ const SendDetails = () => {
setMemo(options.label || options.message);
setAmountUnit(BitcoinUnit.BTC);
setPayjoinUrl(options.pj || '');
// RN Bug: contentOffset gets reset to 0 when state changes. Remove code once this bug is resolved.
setTimeout(() => scrollView.current.scrollToIndex({ index: currentIndex, animated: false }), 50);
}
setIsLoading(false);