expiry time in proposal details
This commit is contained in:
parent
a962e3a913
commit
bcbb0e68d1
2 changed files with 26 additions and 6 deletions
|
|
@ -11,7 +11,7 @@
|
|||
</h1>
|
||||
</section>
|
||||
</nav>
|
||||
<div class="modal-content fix-modals-touch"
|
||||
<div class="modal-content fix-modals-touch"
|
||||
ng-swipe-disable-mouse
|
||||
ng-swipe-right="cancel()"
|
||||
ng-init="updateCopayerList()">
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="oh">
|
||||
<div class="box-notification" ng-show="error">
|
||||
<span class="text-warning size-14">
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
<div class="large-6 medium-6 small-6 columns text-right" ng-show="canSign">
|
||||
<button class="button primary round expand" ng-click="sign(tx)"
|
||||
ng-style="{'background-color':color}"
|
||||
ng-disabled="loading">
|
||||
ng-disabled="loading || (paymentExpired && usePaypro)">
|
||||
<i class="fi-check"></i>
|
||||
<span translate>Accept</span>
|
||||
</button>
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
<li class="line-b p10">
|
||||
<span class="text-gray" translate>Expires</span>
|
||||
<span class="right">
|
||||
<time>{{tx.paypro.expirationDate | amTimeAgo }}</time>
|
||||
<time>{{tx.paypro.expires * 1000 | amTimeAgo }}</time>
|
||||
</span>
|
||||
</li>
|
||||
<li class="line-b p10">
|
||||
|
|
@ -170,7 +170,7 @@
|
|||
{{ac.copayerName}} <span ng-if="ac.copayerId == copayerId">({{'Me'|translate}})</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="columns text-center m20t" ng-if="tx.canBeRemoved || (tx.status == 'accepted' && !tx.broadcastedOn)">
|
||||
<div class="text-gray size-12 m20b" ng-show="!tx.isGlidera && isShared" translate>
|
||||
|
|
|
|||
|
|
@ -285,6 +285,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
var fc = profileService.focusedClient;
|
||||
var currentSpendUnconfirmed = configWallet.spendUnconfirmed;
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||
$scope.paymentExpired = false;
|
||||
$scope.usePaypro = false;
|
||||
checkPaypro();
|
||||
$scope.error = null;
|
||||
$scope.copayers = copayers
|
||||
$scope.copayerId = fc.credentials.copayerId;
|
||||
|
|
@ -306,6 +309,21 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
$scope.getShortNetworkName = function() {
|
||||
return fc.credentials.networkName.substring(0, 4);
|
||||
};
|
||||
|
||||
function checkPaypro() {
|
||||
if(tx.payProUrl && !isChromeApp){
|
||||
fc.fetchPayPro({
|
||||
payProUrl: tx.payProUrl,
|
||||
}, function(err, paypro) {
|
||||
if (err) return $log.debug(err);
|
||||
tx.paypro = paypro;
|
||||
$scope.usePaypro = true;
|
||||
$scope.paymentExpired = tx.paypro.expires <= Math.floor(Date.now() / 1000);
|
||||
$scope.$apply();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
lodash.each(['TxProposalRejectedBy', 'TxProposalAcceptedBy', 'transactionProposalRemoved', 'TxProposalRemoved', 'NewOutgoingTx', 'UpdateTx'], function(eventName) {
|
||||
$rootScope.$on(eventName, function() {
|
||||
fc.getTx($scope.tx.id, function(err, tx) {
|
||||
|
|
@ -324,9 +342,12 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
var action = lodash.find(tx.actions, {
|
||||
copayerId: fc.credentials.copayerId
|
||||
});
|
||||
|
||||
$scope.tx = txFormatService.processTx(tx);
|
||||
|
||||
if (!action && tx.status == 'pending')
|
||||
$scope.tx.pendingForUs = true;
|
||||
|
||||
$scope.updateCopayerList();
|
||||
$scope.$apply();
|
||||
});
|
||||
|
|
@ -1073,7 +1094,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
self.usePaypro = true;
|
||||
self.paymentExpired = false;
|
||||
self.timeToExpire = time;
|
||||
// self.timeToExpire = (Math.floor(Date.now()/1000) + 10);
|
||||
var countDown = $interval(function(){
|
||||
self.timeToExpire--;
|
||||
if(self.timeToExpire <= Math.floor(Date.now() / 1000)){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue