diff --git a/src/js/directives/noLowFee.js b/src/js/directives/noLowFee.js new file mode 100644 index 000000000..b332272e5 --- /dev/null +++ b/src/js/directives/noLowFee.js @@ -0,0 +1,25 @@ +'use strict'; + +angular.module('copayApp.directives') + /** + * Replaces img tag with its svg content to allow for CSS styling of the svg. + */ + .directive('noLowFee', function($log, $ionicHistory, configService, popupService) { + return { + restrict: 'A', + link: function(scope, elem, attrs, ctrl) { + + + elem.bind('click', function() { + configService.whenAvailable(function(config) { + if (config.wallet.settings.feeLevel.match(/conomy/)) { + $log.debug('Economy Fee setting... disabling link:' + elem.text()); + popupService.showAlert('Low Fee Error', 'Please change your Bitcoin Network Fee Policy setting to Normal or higher to use this service', function() { + $ionicHistory.goBack(); + }); + } + }); + }); + } + } + }); diff --git a/www/views/amazon.html b/www/views/amazon.html index 74e34dee1..ba3d7a34a 100644 --- a/www/views/amazon.html +++ b/www/views/amazon.html @@ -15,7 +15,7 @@
Gift Cards are only redeemable on Amazon.com (US website). Cards never expire and can be redeemed towards millions of items.
- +
@@ -33,7 +33,7 @@
+ ui-sref="tabs.giftcards.amazon.amount" no-low-fee> Buy Gift Card diff --git a/www/views/bitpayCard.html b/www/views/bitpayCard.html index 3c760f85f..e37a524f8 100644 --- a/www/views/bitpayCard.html +++ b/www/views/bitpayCard.html @@ -23,7 +23,7 @@ + ui-sref="tabs.bitpayCard.amount({nextStep: 'tabs.bitpayCard.topup'})" no-low-fee> {{'Add Funds'|translate}} diff --git a/www/views/glidera.html b/www/views/glidera.html index 448ec50fb..129b9c5a3 100644 --- a/www/views/glidera.html +++ b/www/views/glidera.html @@ -75,7 +75,7 @@ + href ui-sref="tabs.buyandsell.glidera.amount({nextStep: 'tabs.buyandsell.glidera.sell', currency: currency})" no-low-fee> buy bitcoin Sell Bitcoin