From 53654b3622de38c6cca5d29f9969eb9a67caf8a0 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 24 Jan 2016 03:30:54 +0100 Subject: Redirect to bank page on reserve creation success Fixes #4084. --- extension/pages/confirm-create-reserve.js | 8 ++------ extension/pages/confirm-create-reserve.tsx | 15 ++++----------- extension/pages/reserve-success.html | 29 ----------------------------- 3 files changed, 6 insertions(+), 46 deletions(-) delete mode 100644 extension/pages/reserve-success.html (limited to 'extension/pages') diff --git a/extension/pages/confirm-create-reserve.js b/extension/pages/confirm-create-reserve.js index 8b0fdc536..193f496a6 100644 --- a/extension/pages/confirm-create-reserve.js +++ b/extension/pages/confirm-create-reserve.js @@ -28,14 +28,10 @@ var ConfirmCreateReserve; } showAmount.textContent = s; } - function clone(obj) { - // This is faster than it looks ... - return JSON.parse(JSON.stringify(obj)); - } document.addEventListener("DOMContentLoaded", function (e) { updateAmount(); document.getElementById("confirm").addEventListener("click", function (e) { - var d = clone(query); + var d = Object.assign({}, query); d.mint = document.getElementById('mint-url').value; chrome.runtime.sendMessage({ type: 'confirm-reserve', detail: d }, function (resp) { if (resp.success === true) { @@ -43,7 +39,7 @@ var ConfirmCreateReserve; } else { document.body.innerHTML = - "\n Oops, something went wrong.\n The bank responded with HTTP status code " + resp.status + ".\n Here is some more info:\n
" + resp.text + "
\n "; + "Oops, something went wrong. It looks like the bank could not\n transfer funds to the mint. Please go back to your bank's website\n to check what happened."; } }); }); diff --git a/extension/pages/confirm-create-reserve.tsx b/extension/pages/confirm-create-reserve.tsx index 325f3849c..38776ee6b 100644 --- a/extension/pages/confirm-create-reserve.tsx +++ b/extension/pages/confirm-create-reserve.tsx @@ -32,16 +32,12 @@ namespace ConfirmCreateReserve { showAmount.textContent = s; } - function clone(obj) { - // This is faster than it looks ... - return JSON.parse(JSON.stringify(obj)); - } document.addEventListener("DOMContentLoaded", (e) => { updateAmount(); document.getElementById("confirm").addEventListener("click", (e) => { - let d = clone(query); + let d = Object.assign({}, query); d.mint = (document.getElementById('mint-url') as HTMLInputElement).value; chrome.runtime.sendMessage({type:'confirm-reserve', detail: d}, (resp) => { @@ -49,12 +45,9 @@ namespace ConfirmCreateReserve { document.location.href = resp.backlink; } else { document.body.innerHTML = - ` - Oops, something went wrong. - The bank responded with HTTP status code ${resp.status}. - Here is some more info: -
${resp.text}
- `; + `Oops, something went wrong. It looks like the bank could not + transfer funds to the mint. Please go back to your bank's website + to check what happened.`; } }); diff --git a/extension/pages/reserve-success.html b/extension/pages/reserve-success.html deleted file mode 100644 index 8d5c6aeb4..000000000 --- a/extension/pages/reserve-success.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Taler Wallet: Withdraw operation initiated - - - - -
- -

Withdraw operation initiated

-
- - - -
- -
-

Success!

- -

We have started the process of withdrawing electronic coins. This process may take a bit, but will happen in the background. So you can now continue to browse.

-

You can click on the Taler logo in your navigation bar to check on the progress of the withdrawal operation and your current balance.

-
- -
- - -- cgit v1.2.3