Available funds now accurately reflects the primary currency choice.

This commit is contained in:
Brendon Duncan 2018-07-31 13:25:56 +12:00
commit 71a31ce399

View file

@ -671,21 +671,21 @@ function amountController(configService, $filter, $ionicHistory, $ionicModal, $i
}; };
function updateAvailableFundsStringIfNeeded() { function updateAvailableFundsStringIfNeeded() {
console.log('updateAvailableFundsStringIfNeeded()');
if (vm.fromWalletId && availableSatoshis !== null) { if (vm.fromWalletId && availableSatoshis !== null) {
console.log('updating');
availableFundsInFiat = ''; availableFundsInFiat = '';
vm.availableFunds = availableFundsInCrypto; vm.availableFunds = availableFundsInCrypto;
var coin = availableUnits[altUnitIndex].isFiat ? availableUnits[unitIndex].id : availableUnits[altUnitIndex].id; var coin = availableUnits[altUnitIndex].isFiat ? availableUnits[unitIndex].id : availableUnits[altUnitIndex].id;
txFormatService.formatAlternativeStr(coin, availableSatoshis, function formatCallback(formatted){ txFormatService.formatAlternativeStr(coin, availableSatoshis, function formatCallback(formatted){
console.log('txFormatService returned');
if (formatted) { if (formatted) {
availableFundsInFiat = formatted; availableFundsInFiat = formatted;
if (availableUnits[unitIndex].isFiat) {
vm.availableFunds = availableFundsInFiat; $scope.$apply(function() {
} else { if (availableUnits[unitIndex].isFiat) {
vm.availableFunds = availableFundsInCrypto; vm.availableFunds = availableFundsInFiat;
} } else {
vm.availableFunds = availableFundsInCrypto;
}
});
} }
}); });
} }