bwc
This commit is contained in:
parent
04fb7ba032
commit
320de62f13
348 changed files with 7745 additions and 30874 deletions
47
src/js/services/txStatus.js
Normal file
47
src/js/services/txStatus.js
Normal 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;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue