diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-12-05 19:38:19 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-12-05 19:38:19 +0100 |
commit | f67d7f54f9d0fed97446898942e3dfee67ee2985 (patch) | |
tree | 2b81738025e8f61250ede10908cbf81071e16975 /src/wallet-impl/payback.ts | |
parent | 829acdd3d98f1014747f15ecb619b6fbaa06b640 (diff) | |
download | wallet-core-f67d7f54f9d0fed97446898942e3dfee67ee2985.tar.xz |
threads, retries and notifications WIP
Diffstat (limited to 'src/wallet-impl/payback.ts')
-rw-r--r-- | src/wallet-impl/payback.ts | 9 |
1 files changed, 7 insertions, 2 deletions
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); } |