mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-23 07:15:35 +01:00
Merge pull request #6548 from BlueWallet/im
REF: Place network calls in InteractionManager
This commit is contained in:
commit
552fb95776
1 changed files with 54 additions and 50 deletions
|
@ -106,6 +106,7 @@ export const BlueStorageProvider = ({ children }: { children: React.ReactNode })
|
|||
};
|
||||
|
||||
const refreshAllWalletTransactions = async (lastSnappedTo?: number, showUpdateStatusIndicator: boolean = true) => {
|
||||
InteractionManager.runAfterInteractions(async () => {
|
||||
let noErr = true;
|
||||
try {
|
||||
await BlueElectrum.waitTillConnected();
|
||||
|
@ -131,9 +132,11 @@ export const BlueStorageProvider = ({ children }: { children: React.ReactNode })
|
|||
setWalletTransactionUpdateStatus(WalletTransactionsStatus.NONE);
|
||||
}
|
||||
if (noErr) await saveToDisk(); // caching
|
||||
});
|
||||
};
|
||||
|
||||
const fetchAndSaveWalletTransactions = async (walletID: string) => {
|
||||
InteractionManager.runAfterInteractions(async () => {
|
||||
const index = wallets.findIndex(wallet => wallet.getID() === walletID);
|
||||
let noErr = true;
|
||||
try {
|
||||
|
@ -161,6 +164,7 @@ export const BlueStorageProvider = ({ children }: { children: React.ReactNode })
|
|||
setWalletTransactionUpdateStatus(WalletTransactionsStatus.NONE);
|
||||
}
|
||||
if (noErr) await saveToDisk(); // caching
|
||||
});
|
||||
};
|
||||
|
||||
const addWallet = (wallet: TWallet) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue