mirror of https://github.com/BTCPrivate/copay.git
add logic to txp modal related to glidera
This commit is contained in:
parent
f210418b51
commit
666eee4321
|
@ -1,6 +1,6 @@
|
|||
<div class="ng-animate-disabled row collapse last-transactions-content line-b"
|
||||
ng-class="{'text-gray':!tx.pendingForUs}"
|
||||
ng-click="home.openTxpModal(tx, index.copayers)">
|
||||
ng-click="home.openTxpModal(tx, index.copayers, !!index.glideraStatus)">
|
||||
<div class="small-1 columns text-center" >
|
||||
<i class="icon-circle-active size-10" ng-show="tx.pendingForUs" ng-style="{'color':index.backgroundColor}" style="margin-top:8px;"></i>
|
||||
|
||||
|
|
|
@ -133,15 +133,19 @@
|
|||
</div>
|
||||
|
||||
<div class="text-center text-gray m20t" ng-show="tx.status != 'pending'">
|
||||
<div ng-show="tx.status=='accepted'">
|
||||
<div ng-show="tx.status=='accepted' && !tx.isGlidera" >
|
||||
<div class="m10b size-12" translate>Payment accepted, but not yet broadcasted</div>
|
||||
|
||||
<button class="primary round"
|
||||
ng-click="broadcast(tx)"
|
||||
ng-disabled="loading"> <i class="fi-upload-cloud"></i>
|
||||
ng-disabled="loading"
|
||||
> <i class="fi-upload-cloud"></i>
|
||||
<span translate>Broadcast Payment</span>
|
||||
</button>
|
||||
</div>
|
||||
<div ng-show="tx.status=='accepted' && tx.isGlidera" >
|
||||
<div class="m10 size-12" translate>Payment accepted. It will be broadcasted by Glidera. It case there is a problem, it can be deleted after 6 hours it was created.</div>
|
||||
</div>
|
||||
<div class="text-success m10t"
|
||||
ng-show="tx.status=='broadcasted'" translate>
|
||||
Payment sent
|
||||
|
@ -153,7 +157,7 @@
|
|||
</div>
|
||||
|
||||
<div class="row columns text-center m20t" ng-if="tx.canBeRemoved">
|
||||
<div class="text-gray size-12 m20b" show="tx.canBeRemoved" translate>
|
||||
<div class="text-gray size-12 m20b" ng-if="!tx.isGlidera" translate>
|
||||
* 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>
|
||||
<button class="tiny round outline dark-gray warning" ng-click="remove(tx)"
|
||||
|
|
|
@ -839,6 +839,8 @@ console.log('[index.js:395]',txps); //TODO
|
|||
|
||||
self.initGlidera = function(accessToken) {
|
||||
if (self.isShared) return;
|
||||
self.glideraStatus = null;
|
||||
|
||||
glideraService.setCredentials(self.network);
|
||||
|
||||
var getToken = function(cb) {
|
||||
|
|
|
@ -173,28 +173,30 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
});
|
||||
};
|
||||
|
||||
var GLIDERA_LOCK_TIME = 6 * 60 * 60 * 1000;
|
||||
|
||||
this.openTxpModal = function(tx, copayers) {
|
||||
var GLIDERA_LOCK_TIME = 6 * 60 * 60 ;
|
||||
// isGlidera flag is a security mesure so glidera status is not
|
||||
// only determined by the tx.message
|
||||
this.openTxpModal = function(tx, copayers, isGlidera) {
|
||||
var fc = profileService.focusedClient;
|
||||
var refreshUntilItChanges = false;
|
||||
var currentSpendUnconfirmed = $scope.currentSpendUnconfirmed;
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||
$scope.error = null;
|
||||
$scope.tx = tx;
|
||||
$scope.copayers = copayers
|
||||
$scope.copayerId = fc.credentials.copayerId;
|
||||
$scope.canSign = fc.canSign();
|
||||
$scope.loading = null;
|
||||
$scope.color = fc.backgroundColor;
|
||||
// ToDo: use custom data
|
||||
$scope.isGlidera = false;
|
||||
|
||||
if (tx.message === 'Glidera transaction') {
|
||||
$scope.isGlidera = true;
|
||||
if ($scope.tx.canBeRemoved)
|
||||
$scope.tx.canBeRemoved = (Date.now() - (tx.ts || tx.createdOn)) > GLIDERA_LOCK_TIME;
|
||||
// ToDo: use tx.customData instead of tx.message
|
||||
if (tx.message === 'Glidera transaction' && isGlidera) {
|
||||
tx.isGlidera = true;
|
||||
if (tx.canBeRemoved) {
|
||||
tx.canBeRemoved = (Date.now()/1000 - (tx.ts || tx.createdOn)) > GLIDERA_LOCK_TIME;
|
||||
}
|
||||
}
|
||||
$scope.tx = tx;
|
||||
|
||||
refreshUntilItChanges = false;
|
||||
$scope.currentSpendUnconfirmed = currentSpendUnconfirmed;
|
||||
|
||||
|
|
Loading…
Reference in New Issue