Merge pull request #2898 from matiu/feat/handle-txp-delete
Feat/handle txp delete
This commit is contained in:
commit
d10057c745
3 changed files with 9 additions and 8 deletions
|
|
@ -132,12 +132,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row column m20t" ng-if="tx.couldRemove">
|
<div class="row column m20t" ng-if="tx.canBeRemoved">
|
||||||
<div class="text-gray size-12 text-center m20b" show="tx.couldRemove" translate>
|
<div class="text-gray size-12 text-center m20b" show="tx.canBeRemoved" translate>
|
||||||
* Only payment proposals created by yourself with no peer actions can be removed
|
* A payment proposal can be deleted if 1) you are the creator, and no other copayer has signed, or 2) 24 hours have passed since the proposal was created.
|
||||||
</div>
|
</div>
|
||||||
<button class="tiny expand round outline dark-gray" ng-click="remove(tx)"
|
<button class="tiny expand round outline dark-gray" ng-click="remove(tx)"
|
||||||
ng-disabled="loading" ng-show="tx.couldRemove">
|
ng-disabled="loading" ng-show="tx.canBeRemoved">
|
||||||
<i class="fi-trash size-14 m5r"></i>
|
<i class="fi-trash size-14 m5r"></i>
|
||||||
<span translate>Delete Payment Proposal</span>
|
<span translate>Delete Payment Proposal</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -365,9 +365,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
tx.statusForUs = 'pending';
|
tx.statusForUs = 'pending';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tx.creatorId == self.copayerId && tx.actions.length == 1) {
|
if (!tx.deleteLockTime)
|
||||||
tx.couldRemove = true;
|
tx.canBeRemoved = true;
|
||||||
};
|
|
||||||
|
|
||||||
if (tx.creatorId != self.copayerId) {
|
if (tx.creatorId != self.copayerId) {
|
||||||
self.pendingTxProposalsCountForUs = self.pendingTxProposalsCountForUs + 1;
|
self.pendingTxProposalsCountForUs = self.pendingTxProposalsCountForUs + 1;
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
if (err.code && err.code == 'BADREQUEST' &&
|
if (err.code && err.code == 'BADREQUEST' &&
|
||||||
(eventName == 'transactionProposalRemoved' || eventName == 'TxProposalRemoved')) {
|
(eventName == 'transactionProposalRemoved' || eventName == 'TxProposalRemoved')) {
|
||||||
$scope.tx.removed = true;
|
$scope.tx.removed = true;
|
||||||
$scope.tx.couldRemove = false;
|
$scope.tx.canBeRemoved = false;
|
||||||
$scope.tx.pendingForUs = false;
|
$scope.tx.pendingForUs = false;
|
||||||
$scope.$apply();
|
$scope.$apply();
|
||||||
return;
|
return;
|
||||||
|
|
@ -545,6 +545,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
var errMessage =
|
var errMessage =
|
||||||
fc.credentials.m > 1 ? gettext('Could not create payment proposal') : gettext('Could not send payment');
|
fc.credentials.m > 1 ? gettext('Could not create payment proposal') : gettext('Could not send payment');
|
||||||
|
|
||||||
|
//This are abnormal situations, but still err message will not be translated
|
||||||
|
//(the should) we should switch using err.code and use proper gettext messages
|
||||||
errMessage = errMessage + '. ' + (err.message ? err.message : gettext('Check you connection and try again'));
|
errMessage = errMessage + '. ' + (err.message ? err.message : gettext('Check you connection and try again'));
|
||||||
|
|
||||||
this.error = errMessage;
|
this.error = errMessage;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue