mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-13 19:16:52 +01:00
parent
fe795e648b
commit
3504d0dc30
1 changed files with 2 additions and 20 deletions
|
@ -1,4 +1,4 @@
|
|||
import { RouteProp, useFocusEffect, useRoute, useIsFocused } from '@react-navigation/native';
|
||||
import { RouteProp, useFocusEffect, useRoute } from '@react-navigation/native';
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
|
@ -80,8 +80,6 @@ const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
|
|||
outputRange: [0, -HEADER_HEIGHT],
|
||||
extrapolate: 'clamp',
|
||||
});
|
||||
const flatListRef = useRef<Animated.FlatList>(null);
|
||||
const isFocused = useIsFocused();
|
||||
|
||||
const stylesHook = StyleSheet.create({
|
||||
listHeaderText: {
|
||||
|
@ -95,21 +93,6 @@ const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
|
|||
}, [route, setOptions]),
|
||||
);
|
||||
|
||||
// Reset header position when navigating away from screen
|
||||
useFocusEffect(
|
||||
useCallback(() => {
|
||||
return () => {
|
||||
// This will run when screen loses focus
|
||||
scrollY.setValue(0);
|
||||
// Reset FlatList scroll position to top
|
||||
if (flatListRef.current) {
|
||||
flatListRef.current.scrollToOffset({ offset: 0, animated: false });
|
||||
}
|
||||
setOptions(getWalletTransactionsOptions({ route }));
|
||||
};
|
||||
}, [scrollY, setOptions, route]),
|
||||
);
|
||||
|
||||
const onBarCodeRead = useCallback(
|
||||
(ret?: { data?: any }) => {
|
||||
if (!isLoading) {
|
||||
|
@ -438,7 +421,7 @@ const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
|
|||
}, [wallet, wallet?.hideBalance, wallet?.preferredBalanceUnit, balance]);
|
||||
|
||||
const handleScroll = useCallback(
|
||||
(event: any) => {
|
||||
(event: any) => {
|
||||
const offsetY = event.nativeEvent.contentOffset.y;
|
||||
const combinedHeight = 180;
|
||||
if (offsetY < combinedHeight) {
|
||||
|
@ -508,7 +491,6 @@ const WalletTransactions: React.FC<WalletTransactionsProps> = ({ route }) => {
|
|||
</View>
|
||||
</Animated.View>
|
||||
<Animated.FlatList<Transaction>
|
||||
ref={flatListRef}
|
||||
getItemLayout={getItemLayout}
|
||||
updateCellsBatchingPeriod={30}
|
||||
onEndReachedThreshold={0.3}
|
||||
|
|
Loading…
Add table
Reference in a new issue