diff options
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 79a159d55..4e5fdab71 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -292,7 +292,7 @@ import { getTransactions, getWithdrawalTransactionByUri, parseTransactionIdentifier, - restartAll, + restartAll as restartAllRunningTasks, resumeTransaction, retryAll, retryTransaction, @@ -1248,12 +1248,11 @@ async function dispatchRequestInternal( case WalletApiOperation.HintNetworkAvailability: { const req = codecForHintNetworkAvailabilityRequest().decode(payload); wex.ws.networkAvailable = req.isNetworkAvailable; - if (req.isNetworkAvailable) { - await restartAll(wex); - } else { - // We're not doing anything right now, but we could stop showing - // certain errors! - } + // When network becomes available, restart tasks as they're blocked + // waiting for the network. + // When network goes down, restart tasks so they notice the network + // is down and wait. + await restartAllRunningTasks(wex); return {}; } case WalletApiOperation.ConvertDepositAmount: { |