From ec2bc5e6273318390bdc2494635f4b9a86c06ad6 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Mon, 3 Mar 2025 03:30:19 -0400 Subject: [PATCH] wip --- screen/wallets/WalletTransactions.tsx | 14 ++++++-------- tests/e2e/bluewallet2.spec.js | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/screen/wallets/WalletTransactions.tsx b/screen/wallets/WalletTransactions.tsx index e0e323f97..74f1fe8c2 100644 --- a/screen/wallets/WalletTransactions.tsx +++ b/screen/wallets/WalletTransactions.tsx @@ -13,7 +13,6 @@ import { Text, View, Animated, - RefreshControl, LayoutChangeEvent, } from 'react-native'; import { Icon } from '@rneui/themed'; @@ -298,7 +297,6 @@ const WalletTransactions: React.FC = ({ route }) => { }); const renderItem = useCallback( - // eslint-disable-next-line react/no-unused-prop-types ({ item }: { item: Transaction }) => { return ; }, @@ -468,6 +466,9 @@ const WalletTransactions: React.FC = ({ route }) => { setHeaderHeight(height); }, []); + const refreshProps = + !isDesktop && !isElectrumDisabled ? { onRefresh: refreshTransactions, progressViewOffset: headerHeight, refreshing: isLoading } : {}; + const renderHeader = useCallback(() => { return ( @@ -517,7 +518,8 @@ const WalletTransactions: React.FC = ({ route }) => { testID="TransactionsListView" contentInsetAdjustmentBehavior="automatic" automaticallyAdjustContentInsets - contentContainerStyle={{ backgroundColor: colors.background, marginTop: headerHeight }} + automaticallyAdjustsScrollIndicatorInsets + contentContainerStyle={{ backgroundColor: colors.background, paddingTop: headerHeight }} maxToRenderPerBatch={15} onScroll={Animated.event([{ nativeEvent: { contentOffset: { y: scrollY } } }], { useNativeDriver: true, listener: handleScroll })} scrollEventThrottle={16} @@ -529,11 +531,7 @@ const WalletTransactions: React.FC = ({ route }) => { {isLightning() && {loc.wallets.list_empty_txs2_lightning}} } - refreshControl={ - !isElectrumDisabled && !isDesktop ? ( - refreshTransactions(true)} progressViewOffset={headerHeight} /> - ) : undefined - } + {...refreshProps} /> {wallet?.allowReceive() && ( diff --git a/tests/e2e/bluewallet2.spec.js b/tests/e2e/bluewallet2.spec.js index ca084683f..7bdda1197 100644 --- a/tests/e2e/bluewallet2.spec.js +++ b/tests/e2e/bluewallet2.spec.js @@ -758,7 +758,7 @@ describe('BlueWallet UI Tests - import BIP84 wallet', () => { await waitForId('TransactionsListEmpty'); assert.strictEqual(await countElements('TransactionListItem'), 0); - await element(by.id('TransactionsListView')).swipe('down', 'slow'); // pul-to-refresh + await element(by.id('TransactionsListView')).swipe('down', 'slow', 0.5, 0.5); // pul-to-refresh // asserting balance and txs loaded: await waitForText('0.00105526'); // the wait inside allows network request to propagate