gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-wallet-webex] 02/04: prevent race condition where we


From: gnunet
Subject: [GNUnet-SVN] [taler-wallet-webex] 02/04: prevent race condition where we can accept tip before the background page knows about it
Date: Mon, 09 Apr 2018 00:43:23 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-webex.

commit 6533716fac07e4988ef94231a0c0c8aba68e0d5e
Author: Florian Dold <address@hidden>
AuthorDate: Mon Apr 9 00:20:54 2018 +0200

    prevent race condition where we can accept tip before the background page 
knows about it
---
 src/wallet.ts           | 2 ++
 src/webex/pages/tip.tsx | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/wallet.ts b/src/wallet.ts
index 7c8aa772..1d15722e 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;
   }
diff --git a/src/webex/pages/tip.tsx b/src/webex/pages/tip.tsx
index f21bc0ea..6fbb3005 100644
--- a/src/webex/pages/tip.tsx
+++ b/src/webex/pages/tip.tsx
@@ -127,7 +127,7 @@ class TipDisplay extends React.Component<TipDisplayProps, 
TipDisplayState> {
         <button
             className="pure-button pure-button-primary"
             type="button"
-            disabled={!(this.state.rci && this.state.tipStatus)}
+            disabled={!(this.state.rci && this.state.tipStatus && 
this.state.tipStatus.tipRecord)}
             onClick={() => this.accept()}>
           { this.state.working
             ? <span><object className="svg-icon svg-baseline" 
data="/img/spinner-bars.svg" /> </span>

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]