From e1369ff7e8fc02116b9c4261036f0e42e3423cf4 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 2 Dec 2019 00:42:40 +0100 Subject: the giant refactoring: split wallet into multiple parts --- src/webex/notify.ts | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'src/webex/notify.ts') 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) => { -- cgit v1.2.3