diff options
Diffstat (limited to 'public/js/calculator.js')
| -rw-r--r-- | public/js/calculator.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/public/js/calculator.js b/public/js/calculator.js index 4d0491cf..2808ad64 100644 --- a/public/js/calculator.js +++ b/public/js/calculator.js @@ -18,6 +18,8 @@ g.tip = 1; + g.transactions = []; + $(function() { $.ajax({ url: $('#user').val() + '.json', @@ -169,13 +171,16 @@ $('#received').fadeIn('slow'); $('#success')[0].play(); g.user.index++; - $.post("/" + g.user.username + "/transactions", { - txid: txid, - address: g.user.address, - date: moment().format("YYYY-MM-DD HH:mm:ss"), - received: amount, - exchange: g.exchange - }); + if (g.transactions.indexOf(txid) === -1) { + g.transactions.push(txid); + $.post("/" + g.user.username + "/transactions", { + txid: txid, + address: g.user.address, + date: moment().format("YYYY-MM-DD HH:mm:ss"), + received: amount, + exchange: g.exchange + }); + } return getAddress(); } }; |
