Use the whenAvailable which is called onBeforeEnter so that changed configuration is also reloaded onEnter

This commit is contained in:
Sebastiaan Pasma 2018-06-18 12:44:31 +02:00
commit 51cfa75ffc

View file

@ -12,7 +12,8 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
var currentAddressSocket = {};
var paymentSubscriptionObj = { op:"addr_sub" }
var config = configService.getSync();
var config;
var soundLoaded = false;
var nativeAudioAvailable = (window.plugins && window.plugins.NativeAudio);
@ -243,8 +244,9 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
})
];
configService.whenAvailable(function(config) {
$scope.displayBalanceAsFiat = config.wallet.settings.priceDisplay === 'fiat';
configService.whenAvailable(function(_config) {
$scope.displayBalanceAsFiat = _config.wallet.settings.priceDisplay === 'fiat';
config = _config;
});
});