From 47415cb9fe1423efc22c4b48e3f03b907cf7cf3c Mon Sep 17 00:00:00 2001 From: Andy McKay Date: Fri, 18 Jan 2013 12:15:01 -0800 Subject: [PATCH] cope with cancel (bug 830422) --- media/js/mkt/payments.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/media/js/mkt/payments.js b/media/js/mkt/payments.js index 7f6e8c6b7f..8d09e5c1ae 100644 --- a/media/js/mkt/payments.js +++ b/media/js/mkt/payments.js @@ -62,12 +62,14 @@ define('payments', ['capabilities', 'notification'], function(caps, notification waitForPayment($def, product, webpayJWT, contribStatusURL); }; request.onerror = function() { - console.log('navigator.mozPay error:', this.error.name); - notification({ - classes: 'error', - message: gettext('Payment failed. Try again later.'), - timeout: 5000 - }).then(window.location.reload); + if (this.error.name !== 'cancelled') { + console.log('navigator.mozPay error:', this.error.name); + notification({ + classes: 'error', + message: gettext('Payment failed. Try again later.'), + timeout: 5000 + }).then(window.location.reload); + } $def.reject(null, product, 'MKT_CANCELLED'); }; }