This commit is contained in:
Marcos Rodriguez Velez 2025-03-03 03:30:19 -04:00
parent 0bdfc6fa85
commit ec2bc5e627
2 changed files with 7 additions and 9 deletions

View file

@ -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<WalletTransactionsProps> = ({ route }) => {
});
const renderItem = useCallback(
// eslint-disable-next-line react/no-unused-prop-types
({ item }: { item: Transaction }) => {
return <TransactionListItem item={item} itemPriceUnit={wallet?.preferredBalanceUnit} walletID={walletID} />;
},
@ -468,6 +466,9 @@ const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
setHeaderHeight(height);
}, []);
const refreshProps =
!isDesktop && !isElectrumDisabled ? { onRefresh: refreshTransactions, progressViewOffset: headerHeight, refreshing: isLoading } : {};
const renderHeader = useCallback(() => {
return (
<View style={{ backgroundColor: colors.background }}>
@ -517,7 +518,8 @@ const WalletTransactions: React.FC<WalletTransactionsProps> = ({ 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<WalletTransactionsProps> = ({ route }) => {
{isLightning() && <Text style={styles.emptyTxsLightning}>{loc.wallets.list_empty_txs2_lightning}</Text>}
</View>
}
refreshControl={
!isElectrumDisabled && !isDesktop ? (
<RefreshControl refreshing={isLoading} onRefresh={() => refreshTransactions(true)} progressViewOffset={headerHeight} />
) : undefined
}
{...refreshProps}
/>
<FContainer ref={walletActionButtonsRef}>
{wallet?.allowReceive() && (

View file

@ -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