From 53654b3622de38c6cca5d29f9969eb9a67caf8a0 Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
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.tsx | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

(limited to 'extension/pages/confirm-create-reserve.tsx')

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:
-              <pre>${resp.text}</pre>
-            </div>`;
+            `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.`;
         }
       });
 
-- 
cgit v1.2.3

