diff --git a/js/filters.js b/js/filters.js index a52237d1f..68f014027 100644 --- a/js/filters.js +++ b/js/filters.js @@ -45,12 +45,12 @@ angular.module('copayApp.filters', []) }; }) .filter('noFractionNumber', - [ '$filter', '$locale', - function(filter, locale) { + [ '$filter', '$locale', '$rootScope', + function(filter, locale, $rootScope) { var numberFilter = filter('number'); var formats = locale.NUMBER_FORMATS; return function(amount, n) { - var fractionSize = (typeof(n) != 'undefined') ? n : config.unitToSatoshi.toString().length - 1; + var fractionSize = (typeof(n) != 'undefined') ? n : $rootScope.wallet.settings.unitToSatoshi.toString().length - 1; var value = numberFilter(amount, fractionSize); var sep = value.indexOf(formats.DECIMAL_SEP); var group = value.indexOf(formats.GROUP_SEP); diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 4f603da24..17f1d09cb 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -73,7 +73,7 @@ function Wallet(opts) { this.id = opts.id || Wallet.getRandomId(); this.secretNumber = opts.secretNumber || Wallet.getRandomNumber(); this.lock = new WalletLock(this.storage, this.id, opts.lockTimeOutMin); - this.settings = opts.settings || copayConfig.settings; + this.settings = opts.settings || copayConfig.wallet.settings; this.name = opts.name; this.publicKeyRing.walletId = this.id;