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() {
console.log('updateAvailableFundsStringIfNeeded()');
if (vm.fromWalletId && availableSatoshis !== null) {
console.log('updating');
availableFundsInFiat = '';
vm.availableFunds = availableFundsInCrypto;
var coin = availableUnits[altUnitIndex].isFiat ? availableUnits[unitIndex].id : availableUnits[altUnitIndex].id;
txFormatService.formatAlternativeStr(coin, availableSatoshis, function formatCallback(formatted){
console.log('txFormatService returned');
if (formatted) {
availableFundsInFiat = formatted;
if (availableUnits[unitIndex].isFiat) {
vm.availableFunds = availableFundsInFiat;
} else {
vm.availableFunds = availableFundsInCrypto;
}
$scope.$apply(function() {
if (availableUnits[unitIndex].isFiat) {
vm.availableFunds = availableFundsInFiat;
} else {
vm.availableFunds = availableFundsInCrypto;
}
});
}
});
}