mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-20 10:12:01 +01:00
Merge branch 'master' into plausablehook
This commit is contained in:
commit
9eb3740ac1
@ -141,16 +141,15 @@ const WalletsList = () => {
|
|||||||
* Forcefully fetches TXs and balance for ALL wallets.
|
* Forcefully fetches TXs and balance for ALL wallets.
|
||||||
* Triggered manually by user on pull-to-refresh.
|
* Triggered manually by user on pull-to-refresh.
|
||||||
*/
|
*/
|
||||||
const refreshTransactions = () => {
|
const refreshTransactions = (showLoadingIndicator = true) => {
|
||||||
setIsLoading(true);
|
setIsLoading(showLoadingIndicator);
|
||||||
refreshAllWalletTransactions().finally(() => setIsLoading(false));
|
refreshAllWalletTransactions().finally(() => setIsLoading(false));
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(
|
useEffect(() => {
|
||||||
refreshTransactions,
|
refreshTransactions(false);
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
[],
|
}, []); // call refreshTransactions() only once, when screen mounts
|
||||||
); // call refreshTransactions() only once, when screen mounts
|
|
||||||
|
|
||||||
const handleClick = index => {
|
const handleClick = index => {
|
||||||
console.log('click', index);
|
console.log('click', index);
|
||||||
@ -197,7 +196,6 @@ const WalletsList = () => {
|
|||||||
console.log('onSnapToItem', index);
|
console.log('onSnapToItem', index);
|
||||||
if (wallets[index] && (wallets[index].timeToRefreshBalance() || wallets[index].timeToRefreshTransaction())) {
|
if (wallets[index] && (wallets[index].timeToRefreshBalance() || wallets[index].timeToRefreshTransaction())) {
|
||||||
console.log(wallets[index].getLabel(), 'thinks its time to refresh either balance or transactions. refetching both');
|
console.log(wallets[index].getLabel(), 'thinks its time to refresh either balance or transactions. refetching both');
|
||||||
setIsLoading(true);
|
|
||||||
refreshAllWalletTransactions(index).finally(() => setIsLoading(false));
|
refreshAllWalletTransactions(index).finally(() => setIsLoading(false));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user