This commit is contained in:
Matias Alejo Garcia 2015-03-06 12:00:10 -03:00
commit 320de62f13
348 changed files with 7745 additions and 30874 deletions

View file

@ -0,0 +1,47 @@
'use strict';
angular.module('copayApp.services').factory('txStatus', function($modal, lodash, profileService) {
var root = {};
root.notify = function(txp) {
var fc = profileService.focusedClient;
var msg;
var status = txp.status;
if (status == 'broadcasted') {
msg = 'Transaction broadcasted';
}
else {
var action = lodash.find(txp.actions, {
copayerId: fc.credentials.copayerId
});
if (!action) {
msg = 'Transaction proposal created';
} else if (action.type == 'accept') {
msg = 'Transaction proposal signed';
} else if (action.type == 'reject') {
msg = 'Transaction was rejected';
}
}
if (msg)
root.openModal(msg);
};
root.openModal = function(statusStr) {
var ModalInstanceCtrl = function($scope, $modalInstance) {
$scope.statusStr = statusStr;
$scope.cancel = function() {
$modalInstance.dismiss('cancel');
};
};
$modal.open({
templateUrl: 'views/modals/tx-status.html',
windowClass: 'full',
controller: ModalInstanceCtrl,
});
};
return root;
});