diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-01-26 17:21:17 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-01-26 17:24:42 +0100 |
commit | d2f1cb3234cbeca88903efcfd0d7d406fbece53c (patch) | |
tree | 6c1ab8ea8d3f1a0634aa21c83b6d39c7eac519da /extension/pages/confirm-create-reserve.tsx | |
parent | 5f996fedbc7542e1ba757a5a5856e43931ad7939 (diff) |
fix #4153 and #0004154
Diffstat (limited to 'extension/pages/confirm-create-reserve.tsx')
-rw-r--r-- | extension/pages/confirm-create-reserve.tsx | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/extension/pages/confirm-create-reserve.tsx b/extension/pages/confirm-create-reserve.tsx index 38776ee6b..88af96466 100644 --- a/extension/pages/confirm-create-reserve.tsx +++ b/extension/pages/confirm-create-reserve.tsx @@ -1,6 +1,6 @@ /* This file is part of TALER - (C) 2015 GNUnet e.V. + (C) 2015-2016 GNUnet e.V. TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -16,11 +16,8 @@ "use strict"; -namespace ConfirmCreateReserve { - - let url = URI(document.location.href); - let query: any = URI.parseQuery(url.query()); +export function main() { function updateAmount() { let showAmount = document.getElementById("show-amount"); console.log("Query is " + JSON.stringify(query)); @@ -32,26 +29,25 @@ namespace ConfirmCreateReserve { showAmount.textContent = s; } + let url = URI(document.location.href); + let query: any = URI.parseQuery(url.query()); + + updateAmount(); - document.addEventListener("DOMContentLoaded", (e) => { - updateAmount(); + document.getElementById("confirm").addEventListener("click", (e) => { + let d = Object.assign({}, query); + d.mint = (document.getElementById('mint-url') as HTMLInputElement).value; - document.getElementById("confirm").addEventListener("click", (e) => { - let d = Object.assign({}, query); - d.mint = (document.getElementById('mint-url') as HTMLInputElement).value; - chrome.runtime.sendMessage({type:'confirm-reserve', detail: d}, - (resp) => { - if (resp.success === true) { - document.location.href = resp.backlink; - } else { - document.body.innerHTML = - `Oops, something went wrong. It looks like the bank could not + const cb = (resp) => { + if (resp.success === true) { + document.location.href = resp.backlink; + } else { + document.body.innerHTML = + `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.`; - } - }); - - }); + } + }; + chrome.runtime.sendMessage({type: 'confirm-reserve', detail: d}, cb); }); - }
\ No newline at end of file |