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