From eb84d5747aac0de781d64fb9cdbf2da13006d85e Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 13 Nov 2016 10:17:39 +0100 Subject: [PATCH] fix small react issues --- content_scripts/notify.ts | 23 +- lib/vendor/react-dom.js | 18526 +---------------------------------- lib/vendor/react.js | 3784 +------ lib/wallet/db.ts | 4 +- lib/wallet/query.ts | 16 + lib/wallet/renderHtml.tsx | 10 +- lib/wallet/wallet.ts | 37 + lib/wallet/wxMessaging.ts | 11 + pages/confirm-contract.tsx | 62 +- pages/tree.html | 3 + pages/tree.tsx | 13 +- 11 files changed, 148 insertions(+), 22341 deletions(-) mode change 100644 => 120000 lib/vendor/react-dom.js mode change 100644 => 120000 lib/vendor/react.js diff --git a/content_scripts/notify.ts b/content_scripts/notify.ts index 3b7b231c3..93fd520b3 100644 --- a/content_scripts/notify.ts +++ b/content_scripts/notify.ts @@ -102,6 +102,25 @@ namespace TalerNotify { }); } + function saveOffer(offer: any): Promise { + const walletMsg = { + type: "save-offer", + detail: { + offer: { + contract: offer.contract, + merchant_sig: offer.merchant_sig, + H_contract: offer.H_contract, + offer_time: new Date().getTime() / 1000 + }, + }, + }; + return new Promise((resolve, reject) => { + chrome.runtime.sendMessage(walletMsg, (resp: any) => { + resolve(resp); + }); + }); + } + function init() { chrome.runtime.sendMessage({type: "get-tab-cookie"}, (resp) => { if (chrome.runtime.lastError) { @@ -270,12 +289,12 @@ namespace TalerNotify { } }; await putHistory(historyEntry); + let offerId = await saveOffer(offer); const uri = URI(chrome.extension.getURL( "pages/confirm-contract.html")); const params = { - offer: JSON.stringify(offer), - merchantPageUrl: document.location.href, + offerId: offerId.toString(), }; const target = uri.query(params).href(); if (msg.replace_navigation === true) { diff --git a/lib/vendor/react-dom.js b/lib/vendor/react-dom.js deleted file mode 100644 index 116fbc181..000000000 --- a/lib/vendor/react-dom.js +++ /dev/null @@ -1,18525 +0,0 @@ - /** - * ReactDOM v16.0.0-alpha - */ - -;(function(f) { - // CommonJS - if (typeof exports === "object" && typeof module !== "undefined") { - f(require('react')); - - // RequireJS - } else if (typeof define === "function" && define.amd) { - require(['react'], f); - - //