aboutsummaryrefslogtreecommitdiff
path: root/src/wallet-impl/payback.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet-impl/payback.ts')
-rw-r--r--src/wallet-impl/payback.ts9
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);
}