diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-10-17 15:58:36 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-10-17 15:58:36 +0200 |
commit | 8c0c4b5331d3cb467bb24c253fae3ca623ba5205 (patch) | |
tree | 755247f130c627a093e6e01894d103bceef18312 /content_scripts | |
parent | 6262af4ad73763e736bfb96a88c5d66e0ec51532 (diff) |
automatic refresh
Diffstat (limited to 'content_scripts')
-rw-r--r-- | content_scripts/notify.ts | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/content_scripts/notify.ts b/content_scripts/notify.ts index 7f0673748..959c0e557 100644 --- a/content_scripts/notify.ts +++ b/content_scripts/notify.ts @@ -282,7 +282,9 @@ namespace TalerNotify { addHandler("taler-payment-failed", (msg: any, sendResponse: any) => { const walletMsg = { type: "payment-failed", - detail: {}, + detail: { + contractHash: msg.H_contract + }, }; chrome.runtime.sendMessage(walletMsg, (resp) => { sendResponse(); @@ -290,8 +292,20 @@ namespace TalerNotify { }); addHandler("taler-payment-succeeded", (msg: any, sendResponse: any) => { + if (!msg.H_contract) { + console.error("H_contract missing in taler-payment-succeeded"); + return; + } console.log("got taler-payment-succeeded"); - sendResponse(); + const walletMsg = { + type: "payment-succeeded", + detail: { + contractHash: msg.H_contract, + }, + }; + chrome.runtime.sendMessage(walletMsg, (resp) => { + sendResponse(); + }) }); addHandler("taler-get-payment", (msg: any, sendResponse: any) => { |