get memos working
This commit is contained in:
parent
298956f97f
commit
ade2fb1c80
2 changed files with 38 additions and 6 deletions
|
|
@ -28,18 +28,32 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
|
||||||
if ($scope.btx.action == 'moved') $scope.title = gettextCatalog.getString('Moved Funds');
|
if ($scope.btx.action == 'moved') $scope.title = gettextCatalog.getString('Moved Funds');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//$scope.toAmount = parseInt($scope.toAmount);
|
||||||
|
//$scope.amountStr = txFormatService.formatAmountStr($scope.toAmount);
|
||||||
|
$scope.displayAmount = getDisplayAmount($scope.btx.amountStr);
|
||||||
|
$scope.displayUnit = getDisplayUnit($scope.btx.amountStr);
|
||||||
|
|
||||||
updateMemo();
|
updateMemo();
|
||||||
initActionList();
|
initActionList();
|
||||||
getAlternativeAmount();
|
getAlternativeAmount();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function getDisplayAmount(amountStr) {
|
||||||
|
return amountStr.split(' ')[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDisplayUnit(amountStr) {
|
||||||
|
return amountStr.split(' ')[1];
|
||||||
|
}
|
||||||
|
|
||||||
function updateMemo() {
|
function updateMemo() {
|
||||||
|
console.log('in updateMemo()');
|
||||||
walletService.getTxNote(wallet, $scope.btx.txid, function(err, note) {
|
walletService.getTxNote(wallet, $scope.btx.txid, function(err, note) {
|
||||||
if (err) {
|
if (err) {
|
||||||
$log.warn('Could not fetch transaction note: ' + err);
|
$log.warn('Could not fetch transaction note: ' + err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log('note', note);
|
||||||
if (!note) return;
|
if (!note) return;
|
||||||
|
|
||||||
$scope.btx.note = note;
|
$scope.btx.note = note;
|
||||||
|
|
@ -94,6 +108,9 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
|
||||||
|
|
||||||
$scope.showCommentPopup = function() {
|
$scope.showCommentPopup = function() {
|
||||||
var opts = {};
|
var opts = {};
|
||||||
|
if($scope.btx.message) {
|
||||||
|
opts.defaultText = $scope.btx.message;
|
||||||
|
}
|
||||||
if ($scope.btx.note && $scope.btx.note.body) opts.defaultText = $scope.btx.note.body;
|
if ($scope.btx.note && $scope.btx.note.body) opts.defaultText = $scope.btx.note.body;
|
||||||
|
|
||||||
popupService.showPrompt(wallet.name, gettextCatalog.getString('Memo'), opts, function(text) {
|
popupService.showPrompt(wallet.name, gettextCatalog.getString('Memo'), opts, function(text) {
|
||||||
|
|
|
||||||
|
|
@ -58,17 +58,32 @@
|
||||||
<div>{{wallet.name}}</div>
|
<div>{{wallet.name}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a class="item single-line item-icon-right" ng-hide="insuffientFunds" ng-click="showDescriptionPopup()">
|
<a class="item single-line item-icon-right" ng-hide="insuffientFunds" ng-click="showCommentPopup()">
|
||||||
<span class="label" translate>Add Memo</span>
|
<span class="label" translate>Memo</span>
|
||||||
<span class="item-note m10l">
|
<span class="item-note m10l">
|
||||||
{{description}}
|
<!-- {{btx.note.body}} -->
|
||||||
|
{{btx.note.body || btx.message}}
|
||||||
</span>
|
</span>
|
||||||
<i class="icon bp-arrow-right"></i>
|
<i class="icon bp-arrow-right"></i>
|
||||||
|
|
||||||
|
<!-- <div class="item" ng-click="showCommentPopup()">
|
||||||
|
{{'Memo'|translate}}
|
||||||
|
<span class="item-note" translate ng-if="!btx.note">
|
||||||
|
<i class="icon ion-ios-plus-empty"></i>
|
||||||
|
</span>
|
||||||
|
<span class="item-note" ng-if="btx.note && btx.note.body">
|
||||||
|
{{btx.note.body}}
|
||||||
|
<div>
|
||||||
|
<span translate>Edited by</span> {{btx.note.editedByName}},
|
||||||
|
<time>{{btx.note.editedOn * 1000 | amTimeAgo}}</time>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</div> -->
|
||||||
</a>
|
</a>
|
||||||
<div class="item single-line" ng-hide="insuffientFunds">
|
<div class="item single-line" ng-hide="insuffientFunds">
|
||||||
<span class="label" translate>Fee: {{feeLevel}}</span>
|
<span class="label" translate>Fee</span>
|
||||||
<span class="item-note">
|
<span class="item-note">
|
||||||
{{fee || '...'}}
|
{{btx.feeStr}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue