mv CSV generation from index.js to preferencesHistory.js

This commit is contained in:
Matias Alejo Garcia 2016-06-03 14:44:03 -03:00
commit 9709d6b64a
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
5 changed files with 176 additions and 158 deletions

View file

@ -13,20 +13,21 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
$scope.copayerId = fc.credentials.copayerId;
$scope.isShared = fc.credentials.n > 1;
if ($scope.btx.txid) {
fc.getTxNote({
txid: $scope.btx.txid
}, function(err, note) {
if (err || !note) {
$log.debug(gettextCatalog.getString('Could not fetch transaction note'));
return;
}
$scope.comment = note.body;
$scope.editedBy = gettextCatalog.getString('Edited by') + ' ' + note.editedByName;
$scope.createdOn = note.createdOn;
});
}
console.log('[txDetails.js.16:btx:]',$scope.btx); //TODO
// if ($scope.btx.txid) {
// fc.getTxNote({
// txid: $scope.btx.txid
// }, function(err, note) {
// if (err || !note) {
// $log.debug(gettextCatalog.getString('Could not fetch transaction note'));
// return;
// }
// $scope.comment = note.body;
// $scope.editedBy = gettextCatalog.getString('Edited by') + ' ' + note.editedByName;
// $scope.createdOn = note.createdOn;
// });
// }
//
$scope.showCommentPopup = function() {
$scope.data = {
comment: ''
@ -45,11 +46,16 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
fc.editTxNote({
txid: $scope.btx.txid,
body: $scope.data.comment
}, function() {});
$scope.comment = $scope.data.comment;
$scope.editedBy = gettextCatalog.getString('Edited by') + ' ' + fc.credentials.copayerName;
$scope.createdOn = Math.floor(Date.now() / 1000);
commentPopup.close();
}, 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);
commentPopup.close();
});
};
};