From 09b5bfe0db8271c0c7531e22e3123d7e29e2bb1e Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 3 Sep 2020 17:29:09 +0530 Subject: towards auto-refresh --- packages/taler-wallet-core/src/operations/pending.ts | 3 ++- packages/taler-wallet-core/src/operations/refresh.ts | 5 +++++ packages/taler-wallet-core/src/operations/withdraw.ts | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'packages/taler-wallet-core/src/operations') diff --git a/packages/taler-wallet-core/src/operations/pending.ts b/packages/taler-wallet-core/src/operations/pending.ts index 8cbc5e569..e24e8fc4e 100644 --- a/packages/taler-wallet-core/src/operations/pending.ts +++ b/packages/taler-wallet-core/src/operations/pending.ts @@ -92,7 +92,8 @@ async function gatherExchangePending( }, }); } - if (e.details && e.details.nextUpdateTime.t_ms < now.t_ms) { + const keysUpdateRequired = e.details && e.details.nextUpdateTime.t_ms < now.t_ms; + if (keysUpdateRequired) { resp.pendingOperations.push({ type: PendingOperationType.ExchangeUpdate, givesLifeness: false, diff --git a/packages/taler-wallet-core/src/operations/refresh.ts b/packages/taler-wallet-core/src/operations/refresh.ts index 770c67da6..6c1e643a6 100644 --- a/packages/taler-wallet-core/src/operations/refresh.ts +++ b/packages/taler-wallet-core/src/operations/refresh.ts @@ -634,3 +634,8 @@ export async function createRefreshGroup( refreshGroupId, }; } + +export async function autoRefresh( + ws: InternalWalletState, + exchangeBaseUrl: string, +): Promise {} diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index c719f7ab8..4070e39f4 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -620,6 +620,8 @@ async function processWithdrawGroupImpl( return; } + await updateExchangeFromUrl(ws, withdrawalGroup.exchangeBaseUrl); + const numTotalCoins = withdrawalGroup.denomsSel.selectedDenoms .map((x) => x.count) .reduce((a, b) => a + b); -- cgit v1.2.3