diff options
author | Sebastian <sebasjm@gmail.com> | 2022-05-18 15:57:10 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-05-18 15:57:10 -0300 |
commit | 5595e942b44135e11af85d6a4e633239a3a8997f (patch) | |
tree | ff2773d2f29290fc1819f766315b87c6a3f24dfd /packages/taler-wallet-core/src/operations/tip.ts | |
parent | 145714b335be7896501afe21cb8c7419c1e9cb83 (diff) | |
download | wallet-core-5595e942b44135e11af85d6a4e633239a3a8997f.tar.xz |
fix: update retry info before return
Diffstat (limited to 'packages/taler-wallet-core/src/operations/tip.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/tip.ts | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts index da7673f35..9ca1ccb5a 100644 --- a/packages/taler-wallet-core/src/operations/tip.ts +++ b/packages/taler-wallet-core/src/operations/tip.ts @@ -205,23 +205,6 @@ export async function processTip( ); } -async function resetTipRetry( - ws: InternalWalletState, - tipId: string, -): Promise<void> { - await ws.db - .mktx((x) => ({ - tips: x.tips, - })) - .runReadWrite(async (tx) => { - const x = await tx.tips.get(tipId); - if (x) { - x.retryInfo = RetryInfo.reset(); - await tx.tips.put(x); - } - }); -} - async function processTipImpl( ws: InternalWalletState, walletTipId: string, @@ -230,9 +213,8 @@ async function processTipImpl( } = {}, ): Promise<void> { const forceNow = options.forceNow ?? false; - if (forceNow) { - await resetTipRetry(ws, walletTipId); - } + await setupTipRetry(ws, walletTipId, { reset: forceNow }); + const tipRecord = await ws.db .mktx((x) => ({ tips: x.tips, |