From 6533716fac07e4988ef94231a0c0c8aba68e0d5e Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 9 Apr 2018 00:20:54 +0200 Subject: prevent race condition where we can accept tip before the background page knows about it --- src/wallet.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/wallet.ts') diff --git a/src/wallet.ts b/src/wallet.ts index 7c8aa7729..1d15722e3 100644 --- a/src/wallet.ts +++ b/src/wallet.ts @@ -2801,6 +2801,7 @@ export class Wallet { let merchantResp; tipRecord = await this.q().putOrGetExisting(Stores.tips, tipRecord, [tipRecord.tipId, merchantDomain]); + this.notifier.notify(); // Planchets in the form that the merchant expects const planchetsDetail: TipPlanchetDetail[] = tipRecord.planchets.map((p) => ({ @@ -2846,6 +2847,7 @@ export class Wallet { tipRecord.pickedUp = true; await this.q().put(Stores.tips, tipRecord).finish(); + this.notifier.notify(); return tipRecord; } -- cgit v1.2.3