diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-03-04 18:09:19 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-03-04 18:09:19 +0100 |
commit | 1b2897c03b08e730a2e965e50bbd2104a7a81eef (patch) | |
tree | bc86921fcebae59a776dbf7bb16f3534d75d9979 | |
parent | 26695aa3513b2eb7c37d978b8c1534f6bc484a07 (diff) | |
download | wallet-core-1b2897c03b08e730a2e965e50bbd2104a7a81eef.tar.xz |
more const-ness
-rw-r--r-- | content_scripts/notify.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/content_scripts/notify.ts b/content_scripts/notify.ts index e53a11c93..a37617726 100644 --- a/content_scripts/notify.ts +++ b/content_scripts/notify.ts @@ -43,14 +43,14 @@ namespace TalerNotify { return url; } - let handlers = []; + const handlers = []; let connected = false; // Hack to know when the extension is unloaded let port; - let connect = (dh) => { + const connect = (dh) => { port = chrome.runtime.connect(); port.onDisconnect.addListener(dh); chrome.runtime.sendMessage({type: "ping"}, () => { @@ -77,7 +77,7 @@ namespace TalerNotify { connect(disconectHandler); function registerHandlers() { - let $ = (x) => document.getElementById(x); + const $ = (x) => document.getElementById(x); function addHandler(type, listener) { document.addEventListener(type, listener); @@ -134,14 +134,14 @@ namespace TalerNotify { return; } - let offer = e.detail.contract_wrapper; + const offer = e.detail.contract_wrapper; if (!offer.contract) { console.error("contract field missing"); return; } - let msg = { + const msg = { type: "check-repurchase", detail: { contract: offer.contract @@ -161,12 +161,12 @@ namespace TalerNotify { resp.existingContractHash); } else { - let uri = URI(chrome.extension.getURL("pages/confirm-contract.html")); - let params = { + const uri = URI(chrome.extension.getURL("pages/confirm-contract.html")); + const params = { offer: JSON.stringify(offer), merchantPageUrl: document.location.href, }; - let target = uri.query(params).href(); + const target = uri.query(params).href(); if (e.detail.replace_navigation === true) { document.location.replace(target); } else { @@ -183,8 +183,8 @@ namespace TalerNotify { console.log("field 'pay_url' missing in taler-execute-payment event"); return; } - let payUrl = e.detail.pay_url; - let msg = { + const payUrl = e.detail.pay_url; + const msg = { type: "execute-payment", detail: { H_contract: e.detail.H_contract, |