From d8a155a0e81c88881e8140b2fc5829eaa59bba45 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 5 Aug 2015 16:34:05 -0300 Subject: [PATCH] Hide options if it is the old bws --- public/views/preferences.html | 5 +++-- public/views/preferencesFee.html | 2 +- public/views/walletHome.html | 22 ++++++++++++---------- src/js/services/feeService.js | 8 ++------ 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/public/views/preferences.html b/public/views/preferences.html index 416dd9522..3f1e1d0cf 100644 --- a/public/views/preferences.html +++ b/public/views/preferences.html @@ -77,11 +77,12 @@ {{preferences.selectedAlternative.name}} -
  • +
  • Bitcoin Network Fee Policy - {{index.feeOpts[index.currentFeeLevel]|translate}} + {{index.feeOpts[index.currentFeeLevel]|translate}}
  • diff --git a/public/views/preferencesFee.html b/public/views/preferencesFee.html index 425164145..7eb64566d 100644 --- a/public/views/preferencesFee.html +++ b/public/views/preferencesFee.html @@ -7,7 +7,7 @@ diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 951e56c88..02ecebe38 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -427,16 +427,18 @@
    -

    Fee policy for this transaction

    -
      -
    • - {{index.feeOpts[fee.level]|translate}} - -
    • -
    -

    Use unconfirmed funds for this transaction

    +
    +

    Fee policy for this transaction

    +
      +
    • + {{index.feeOpts[fee.level]|translate}} + +
    • +
    +
    +

     

    Use Unconfirmed Funds diff --git a/src/js/services/feeService.js b/src/js/services/feeService.js index e77901bc4..3b7f810ce 100644 --- a/src/js/services/feeService.js +++ b/src/js/services/feeService.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.services').factory('feeService', function($log, profileService, configService, gettextCatalog) { +angular.module('copayApp.services').factory('feeService', function($log, profileService, configService, gettextCatalog, lodash) { var root = {}; // Constant fee options to translate @@ -21,11 +21,7 @@ angular.module('copayApp.services').factory('feeService', function($log, profile return cb({message: 'Could not get dynamic fee. Using static 10000sat'}, fee); } else { - for (var i = 0; i < 3; i++) { - if (levels[i].level == feeLevel) { - fee = levels[i].feePerKB; - } - } + fee = lodash.find(levels, { level: feeLevel }).feePerKB; $log.debug('Dynamic fee for ' + feeLevel + ': ' + fee); return cb(null, fee); }