full precision on tx details modal
This commit is contained in:
parent
27f3ebf376
commit
d477effd07
4 changed files with 14 additions and 7 deletions
|
|
@ -692,8 +692,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
$log.debug('Fixing Tx Cache Unit to:' + name)
|
$log.debug('Fixing Tx Cache Unit to:' + name)
|
||||||
lodash.each(txs, function(tx) {
|
lodash.each(txs, function(tx) {
|
||||||
|
|
||||||
tx.amountStr = profileService.formatAmount(tx.amount, config.unitName) + name;
|
tx.amountStr = profileService.formatAmount(tx.amount) + name;
|
||||||
tx.feeStr = profileService.formatAmount(tx.fees, config.unitName) + name;
|
tx.feeStr = profileService.formatAmount(tx.fees) + name;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,10 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
|
||||||
$scope.color = fc.backgroundColor;
|
$scope.color = fc.backgroundColor;
|
||||||
$scope.copayerId = fc.credentials.copayerId;
|
$scope.copayerId = fc.credentials.copayerId;
|
||||||
$scope.isShared = fc.credentials.n > 1;
|
$scope.isShared = fc.credentials.n > 1;
|
||||||
|
|
||||||
|
$scope.btx.amountStr = profileService.formatAmount($scope.btx.amount, true) + ' ' + walletSettings.unitName;
|
||||||
|
$scope.btx.feeStr = profileService.formatAmount($scope.btx.fees, true) + ' ' + walletSettings.unitName;
|
||||||
|
|
||||||
$scope.showCommentPopup = function() {
|
$scope.showCommentPopup = function() {
|
||||||
$scope.data = {
|
$scope.data = {
|
||||||
comment: $scope.btx.note ? $scope.btx.note.body : '',
|
comment: $scope.btx.note ? $scope.btx.note.body : '',
|
||||||
|
|
@ -42,7 +46,7 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// This is only to refresh the current screen data
|
// This is only to refresh the current screen data
|
||||||
$scope.btx.note = null;
|
$scope.btx.note = null;
|
||||||
if (args.body) {
|
if (args.body) {
|
||||||
$scope.btx.note = {};
|
$scope.btx.note = {};
|
||||||
$scope.btx.note.body = $scope.data.comment;
|
$scope.btx.note.body = $scope.data.comment;
|
||||||
|
|
|
||||||
|
|
@ -418,7 +418,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
return self.setSendError(gettext(msg));
|
return self.setSendError(gettext(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (form.amount.$modelValue * unitToSat > Number.MAX_SAFE_INTEGER) {
|
if (form.amount.$modelValue * unitToSat > Number.MAX_SAFE_INTEGER) {
|
||||||
var msg = 'Amount too big';
|
var msg = 'Amount too big';
|
||||||
$log.warn(msg);
|
$log.warn(msg);
|
||||||
return self.setSendError(gettext(msg));
|
return self.setSendError(gettext(msg));
|
||||||
|
|
@ -811,7 +811,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
this.openTxModal = function(btx) {
|
this.openTxModal = function(btx) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
$scope.btx = btx;
|
$scope.btx = lodash.cloneDeep(btx);
|
||||||
$scope.self = self;
|
$scope.self = self;
|
||||||
|
|
||||||
$ionicModal.fromTemplateUrl('views/modals/tx-details.html', {
|
$ionicModal.fromTemplateUrl('views/modals/tx-details.html', {
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,15 @@ angular.module('copayApp.services')
|
||||||
root.walletClients = {};
|
root.walletClients = {};
|
||||||
|
|
||||||
root.Utils = bwcService.getUtils();
|
root.Utils = bwcService.getUtils();
|
||||||
root.formatAmount = function(amount) {
|
root.formatAmount = function(amount, fullPrecision) {
|
||||||
var config = configService.getSync().wallet.settings;
|
var config = configService.getSync().wallet.settings;
|
||||||
if (config.unitCode == 'sat') return amount;
|
if (config.unitCode == 'sat') return amount;
|
||||||
|
|
||||||
//TODO : now only works for english, specify opts to change thousand separator and decimal separator
|
//TODO : now only works for english, specify opts to change thousand separator and decimal separator
|
||||||
return this.Utils.formatAmount(amount, config.unitCode);
|
var opts = {
|
||||||
|
fullPrecision: !!fullPrecision
|
||||||
|
};
|
||||||
|
return this.Utils.formatAmount(amount, config.unitCode, opts);
|
||||||
};
|
};
|
||||||
|
|
||||||
root._setFocus = function(walletId, cb) {
|
root._setFocus = function(walletId, cb) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue