diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts b/packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts index 58a1c2b3c..3e5750af7 100644 --- a/packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts +++ b/packages/taler-wallet-core/src/operations/pay-peer-push-credit.ts @@ -22,6 +22,7 @@ import { ExchangePurseMergeRequest, HttpStatusCode, Logger, + NotificationType, PeerContractTerms, PreparePeerPushCreditRequest, PreparePeerPushCreditResponse, @@ -60,7 +61,12 @@ import { } from "../index.js"; import { assertUnreachable } from "../util/assertUnreachable.js"; import { checkDbInvariant } from "../util/invariants.js"; -import { OperationAttemptResult, OperationAttemptResultType, constructTaskIdentifier, runLongpollAsync } from "./common.js"; +import { + OperationAttemptResult, + OperationAttemptResultType, + constructTaskIdentifier, + runLongpollAsync, +} from "./common.js"; import { updateExchangeFromUrl } from "./exchanges.js"; import { codecForExchangePurseStatus, @@ -206,6 +212,8 @@ export async function preparePeerPushCredit( }); }); + ws.notify({ type: NotificationType.BalanceChange }); + return { amount: purseStatus.balance, amountEffective: wi.withdrawalAmountEffective, @@ -631,15 +639,15 @@ export async function confirmPeerPushCredit( } peerPushPaymentIncomingId = parsedTx.peerPushPaymentIncomingId; } else { - throw Error("no transaction ID (or deprecated peerPushPaymentIncomingId) provided"); + throw Error( + "no transaction ID (or deprecated peerPushPaymentIncomingId) provided", + ); } await ws.db .mktx((x) => [x.contractTerms, x.peerPushPaymentIncoming]) .runReadWrite(async (tx) => { - peerInc = await tx.peerPushPaymentIncoming.get( - peerPushPaymentIncomingId, - ); + peerInc = await tx.peerPushPaymentIncoming.get(peerPushPaymentIncomingId); if (!peerInc) { return; } |