REF: refresh wallet if it never been done

This commit is contained in:
Ivan Vershigora 2021-04-15 11:05:19 +03:00
parent 602f16f1b4
commit 0f523a0c0c

View File

@ -147,10 +147,9 @@ const WalletTransactions = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [walletID]);
// if balance of the wallet positive and there are no transactions, then
// it'a freshly impoted wallet and we need to refresh transactions
// refresh transactions if it never hasn't been done. It could be a fresh imported wallet
useEffect(() => {
if (dataSource.length === 0 && wallet.getBalance() > 0) {
if (wallet._lastTxFetch === 0) {
refreshTransactions();
}
// eslint-disable-next-line react-hooks/exhaustive-deps