diff --git a/js/controllers/transactions.js b/js/controllers/transactions.js index 7f15c02df..7dd03f52b 100644 --- a/js/controllers/transactions.js +++ b/js/controllers/transactions.js @@ -4,6 +4,8 @@ var bitcore = require('bitcore'); angular.module('copayApp.controllers').controller('TransactionsController', function($scope, $rootScope, $timeout, controllerUtils, notification) { + var w = $rootScope.wallet; + $scope.title = 'Transactions'; $scope.loading = false; $scope.lastShowed = false; @@ -12,7 +14,7 @@ angular.module('copayApp.controllers').controller('TransactionsController', $scope.txpItemsPerPage = 4; $scope.blockchain_txs = []; - var satToUnit = 1 / config.unitToSatoshi; + var satToUnit = 1 / w.settings.unitToSatoshi; $scope.update = function() { $scope.loading = true; diff --git a/js/directives.js b/js/directives.js index e8024cab5..82704b104 100644 --- a/js/directives.js +++ b/js/directives.js @@ -47,13 +47,14 @@ angular.module('copayApp.directives') .directive('enoughAmount', ['$rootScope', function($rootScope) { var bitcore = require('bitcore'); + var w = $rootScope.wallet; var feeSat = Number(bitcore.TransactionBuilder.FEE_PER_1000B_SAT); return { require: 'ngModel', link: function(scope, element, attrs, ctrl) { var val = function(value) { - var availableBalanceNum = Number(($rootScope.availableBalance * config.unitToSatoshi).toFixed(0)); - var vNum = Number((value * config.unitToSatoshi).toFixed(0)); + var availableBalanceNum = Number(($rootScope.availableBalance * w.settings.unitToSatoshi).toFixed(0)); + var vNum = Number((value * w.settings.unitToSatoshi).toFixed(0)); if (typeof vNum == "number" && vNum > 0) { vNum = vNum + feeSat; diff --git a/js/services/controllerUtils.js b/js/services/controllerUtils.js index ba3b6da98..899348ed4 100644 --- a/js/services/controllerUtils.js +++ b/js/services/controllerUtils.js @@ -175,7 +175,7 @@ angular.module('copayApp.services') w.getBalance(function(err, balanceSat, balanceByAddrSat, safeBalanceSat) { if (err) throw err; - var satToUnit = 1 / config.unitToSatoshi; + var satToUnit = 1 / w.settings.unitToSatoshi; var COIN = bitcore.util.COIN; $rootScope.totalBalance = balanceSat * satToUnit; @@ -210,7 +210,7 @@ angular.module('copayApp.services') if (!w) return; opts = opts || $rootScope.txsOpts || {}; - var satToUnit = 1 / config.unitToSatoshi; + var satToUnit = 1 / w.settings.unitToSatoshi; var myCopayerId = w.getMyCopayerId(); var pendingForUs = 0; var inT = w.getTxProposals().sort(function(t1, t2) {