fix new variable names

This commit is contained in:
Matias Alejo Garcia 2016-06-04 16:30:36 -03:00
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> <span class="text-gray" translate>See it on the blockchain</span>
</button> </button>
<button class="button outline round dark-gray tiny" ng-click="showCommentPopup()"> <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="!btx.note">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">Edit comment</span>
</button> </button>
</div> </div>
</div> </div>

View file

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