From f67d7f54f9d0fed97446898942e3dfee67ee2985 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 5 Dec 2019 19:38:19 +0100 Subject: threads, retries and notifications WIP --- src/wallet-impl/payback.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/wallet-impl/payback.ts') diff --git a/src/wallet-impl/payback.ts b/src/wallet-impl/payback.ts index 5bf5ff06e..56696d771 100644 --- a/src/wallet-impl/payback.ts +++ b/src/wallet-impl/payback.ts @@ -29,6 +29,7 @@ import { Stores, TipRecord, CoinStatus } from "../dbTypes"; import { Logger } from "../util/logging"; import { PaybackConfirmation } from "../talerTypes"; import { updateExchangeFromUrl } from "./exchanges"; +import { NotificationType } from "../walletTypes"; const logger = new Logger("payback.ts"); @@ -65,7 +66,9 @@ export async function payback( await tx.put(Stores.reserves, reserve); }, ); - ws.notifier.notify(); + ws.notify({ + type: NotificationType.PaybackStarted, + }); const paybackRequest = await ws.cryptoApi.createPaybackRequest(coin); const reqUrl = new URL("payback", coin.exchangeBaseUrl); @@ -83,6 +86,8 @@ export async function payback( } coin.status = CoinStatus.Dormant; await oneShotPut(ws.db, Stores.coins, coin); - ws.notifier.notify(); + ws.notify({ + type: NotificationType.PaybackFinished, + }); await updateExchangeFromUrl(ws, coin.exchangeBaseUrl, true); } -- cgit v1.2.3