aboutsummaryrefslogtreecommitdiff
path: root/src/webex/notify.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-12-02 00:42:40 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-12-02 00:42:40 +0100
commite1369ff7e8fc02116b9c4261036f0e42e3423cf4 (patch)
treec621067ebda8977a888bfed34b7bbecf64b3b0f0 /src/webex/notify.ts
parentaaf7e1338d6cdb1b4e01ad318938b3eaea2f922b (diff)
downloadwallet-core-e1369ff7e8fc02116b9c4261036f0e42e3423cf4.tar.xz
the giant refactoring: split wallet into multiple parts
Diffstat (limited to 'src/webex/notify.ts')
-rw-r--r--src/webex/notify.ts28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/webex/notify.ts b/src/webex/notify.ts
index 4e53c3e1f..61a96cb1b 100644
--- a/src/webex/notify.ts
+++ b/src/webex/notify.ts
@@ -24,8 +24,6 @@
/**
* Imports.
*/
-import URI = require("urijs");
-
import wxApi = require("./wxApi");
declare var cloneInto: any;
@@ -180,25 +178,19 @@ function registerHandlers() {
});
addHandler("taler-create-reserve", (msg: any) => {
- const params = {
- amount: JSON.stringify(msg.amount),
- bank_url: document.location.href,
- callback_url: new URI(msg.callback_url) .absoluteTo(document.location.href),
- suggested_exchange_url: msg.suggested_exchange_url,
- wt_types: JSON.stringify(msg.wt_types),
- };
- const uri = new URI(chrome.extension.getURL("/src/webex/pages/confirm-create-reserve.html"));
- const redirectUrl = uri.query(params).href();
- window.location.href = redirectUrl;
+ const uri = new URL(chrome.extension.getURL("/src/webex/pages/confirm-create-reserve.html"));
+ uri.searchParams.set("amount", JSON.stringify(msg.amount));
+ uri.searchParams.set("bank_url", document.location.href);
+ uri.searchParams.set("callback_url", new URL(msg.callback_url, document.location.href).href);
+ uri.searchParams.set("suggested_exchange_url", msg.suggested_exchange_url);
+ uri.searchParams.set("wt_types", JSON.stringify(msg.wt_types));
+ window.location.href = uri.href;
});
addHandler("taler-add-auditor", (msg: any) => {
- const params = {
- req: JSON.stringify(msg),
- };
- const uri = new URI(chrome.extension.getURL("/src/webex/pages/add-auditor.html"));
- const redirectUrl = uri.query(params).href();
- window.location.href = redirectUrl;
+ const uri = new URL(chrome.extension.getURL("/src/webex/pages/add-auditor.html"));
+ uri.searchParams.set("req", JSON.stringify(msg))
+ window.location.href = uri.href;
});
addHandler("taler-confirm-reserve", async (msg: any, sendResponse: any) => {