From 394317bc46b516db3a477fbcfced7e09e668054c Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Thu, 6 Sep 2018 11:27:48 +1200 Subject: [PATCH] Better default error message for Shapeshift error. --- i18n/po/template.pot | 4 ++++ src/js/controllers/amount.js | 9 ++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/i18n/po/template.pot b/i18n/po/template.pot index eed30bbb8..10b3de712 100644 --- a/i18n/po/template.pot +++ b/i18n/po/template.pot @@ -3854,3 +3854,7 @@ msgstr "" #: www/views/amount.html.js:60 msgid "Send Maximum Amount" msgstr "" + +#: src/js/controllers/amount.controller.js:239 +msgid "Unknown error." +msgstr "" \ No newline at end of file diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index fdbcfe5bf..cc78058bd 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -221,7 +221,6 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory, } function initForShapeshift() { - console.log('initForShapeshift()'); if (vm.thirdParty.id === 'shapeshift') { vm.thirdParty.data = vm.thirdParty.data || {}; @@ -234,17 +233,17 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory, ongoingProcess.set('connectingShapeshift', true); shapeshiftService.getMarketData(vm.fromWallet.coin, vm.toWallet.coin, function onMarketData(data) { - console.log('sendmax onMarketData()'); ongoingProcess.set('connectingShapeshift', false); if (data.error) { - // TODO: translatable string. use goBack(), don't execute the code beyond. + var defaultErrorMessage = gettextCatalog.getString('Unknown error.'); popupService.showAlert( gettextCatalog.getString('Shapeshift Error'), - typeof data.error === 'string' ? data.error : (data.error.message ? data.error.message : ''), + typeof data.error === 'string' ? data.error : (data.error.message ? data.error.message : defaultErrorMessage), function () { goBack(); - }); + } + ); } else { vm.thirdParty.data.minAmount = vm.minAmount = parseFloat(data.minimum);