diff options
author | Iván Ávalos <avalos@disroot.org> | 2024-06-21 17:15:13 -0600 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-06-26 16:32:05 +0200 |
commit | 7c989435fb7dabf689b16c4180b9f257d734663f (patch) | |
tree | 53c7ff2d15a1140d63e9a586fbc1fa88006dd2f9 /packages/taler-wallet-core/src/exchanges.ts | |
parent | ca86c0a3463a46605d41af27fb62606427c9a217 (diff) | |
download | wallet-core-7c989435fb7dabf689b16c4180b9f257d734663f.tar.xz |
make tasks return network-required when offline
Diffstat (limited to 'packages/taler-wallet-core/src/exchanges.ts')
-rw-r--r-- | packages/taler-wallet-core/src/exchanges.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/exchanges.ts b/packages/taler-wallet-core/src/exchanges.ts index 4043d3498..8fa439715 100644 --- a/packages/taler-wallet-core/src/exchanges.ts +++ b/packages/taler-wallet-core/src/exchanges.ts @@ -1301,6 +1301,10 @@ export async function updateExchangeFromUrlHandler( wex: WalletExecutionContext, exchangeBaseUrl: string, ): Promise<TaskRunResult> { + if (!wex.ws.networkAvailable) { + return TaskRunResult.networkRequired(); + } + logger.trace(`updating exchange info for ${exchangeBaseUrl}`); const oldExchangeRec = await wex.db.runReadOnlyTx( |