fix new variable names

This commit is contained in:
Matias Alejo Garcia 2016-06-04 16:30:36 -03:00
parent d7e8ca4404
commit d296601d09
No known key found for this signature in database
GPG Key ID: 02470DB551277AB3
2 changed files with 9 additions and 7 deletions

View File

@ -156,8 +156,8 @@
<span class="text-gray" translate>See it on the blockchain</span>
</button>
<button class="button outline round dark-gray tiny" ng-click="showCommentPopup()">
<span class="text-gray" translate ng-show="!comment">Add a comment</i></span>
<span class="text-gray" translate ng-show="comment">Edit comment</span>
<span class="text-gray" translate ng-show="!btx.note">Add a comment</i></span>
<span class="text-gray" translate ng-show="btx.note">Edit comment</span>
</button>
</div>
</div>

View File

@ -14,7 +14,7 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
$scope.isShared = fc.credentials.n > 1;
$scope.showCommentPopup = function() {
$scope.data = {
comment: ''
comment: $scope.btx.note.body
};
var commentPopup = $ionicPopup.show({
@ -27,17 +27,19 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
};
$scope.commentPopupSave = function() {
$log.debug('Saving note');
fc.editTxNote({
txid: $scope.btx.txid,
body: $scope.data.comment
body: $scope.data.comment,
}, function(err) {
if (err) {
$log.debug('Could not save tx comment');
return;
}
$scope.comment = $scope.data.comment;
$scope.editedBy = gettextCatalog.getString('Edited by') + ' ' + fc.credentials.copayerName;
$scope.createdOn = Math.floor(Date.now() / 1000);
// This is only to refresh the current screen data
$scope.btx.note.body = $scope.data.comment;
$scope.btx.note.editedByName = fc.credentials.copayerName;
$scope.btx.note.editedOn = Math.floor(Date.now() / 1000);
commentPopup.close();
});
};