Merge branch 'wallet/sprint/17' into wallet/task/358

This commit is contained in:
Sebastiaan Pasma 2018-05-28 13:55:31 +02:00 committed by GitHub
commit edc398015a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 196 additions and 29 deletions

View file

@ -322,7 +322,6 @@ angular.module('copayApp.controllers').controller('amountController', function($
$scope.amountModel.amount = ($scope.amountModel.amount + digit).replace('..', '.');
checkFontSize();
$scope.processAmount();
navigator.vibrate(50);
};
$scope.pushOperator = function(operator) {
@ -358,7 +357,6 @@ angular.module('copayApp.controllers').controller('amountController', function($
$scope.amountModel.amount = $scope.alternativeAmount = $scope.globalResult = '';
$scope.allowSend = false;
checkFontSize();
navigator.vibrate(50);
};

View file

@ -205,6 +205,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
}
});
$scope.displayBalanceAsFiat = walletConfig.settings.priceDisplay === 'fiat';
});

View file

@ -4,7 +4,7 @@ angular.module('copayApp.controllers').controller('preferencesAbout',
function($scope, $window, appConfigService, gettextCatalog, externalLinkService, $ionicNavBarDelegate) {
$scope.title = gettextCatalog.getString('About') + ' ' + appConfigService.nameCase;
$scope.version = $window.version;
$scope.version = $window.fullVersion;
$scope.commitHash = $window.commitHash;
$scope.openExternalLink = function() {

View file

@ -13,6 +13,8 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
var currentAddressSocket = {};
var paymentSubscriptionObj = { op:"addr_sub" }
$scope.displayBalanceAsFiat = true;
$scope.requestSpecificAmount = function() {
$state.go('tabs.paymentRequest.amount', {
id: $scope.wallet.credentials.walletId,
@ -212,6 +214,10 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
if ($scope.wallet && walletId == $scope.wallet.id && type == 'NewIncomingTx') $scope.setAddress(true);
})
];
configService.whenAvailable(function(config) {
$scope.displayBalanceAsFiat = config.wallet.settings.priceDisplay === 'fiat';
});
});
$scope.$on("$ionicView.enter", function(event, data) {

View file

@ -108,6 +108,9 @@ angular.module('copayApp.controllers').controller('tabScanController', function(
function handleSuccessfulScan(contents){
$log.debug('Scan returned: "' + contents + '"');
scannerService.pausePreview();
// Sometimes (testing in Chrome, when reading QR Code) data is an object
// that has a string data.result.
contents = contents.result || contents;
incomingData.redir(contents);
}

View file

@ -72,15 +72,22 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
return item.network == 'livenet';
});
}
var walletList = [];
lodash.each(walletsToTransfer, function(v) {
var displayBalanceAsFiat =
v.status.alternativeBalanceAvailable &&
config.wallet.settings.priceDisplay === 'fiat';
walletList.push({
color: v.color,
name: v.name,
recipientType: 'wallet',
coin: v.coin,
network: v.network,
balanceString: v.cachedBalance,
balanceString: displayBalanceAsFiat ?
v.status.totalBalanceAlternative + ' ' + v.status.alternativeIsoCode :
v.cachedBalance,
getAddress: function(cb) {
walletService.getAddress(v, false, cb);
},