Fix txp modals

This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-27 12:57:46 -03:00
commit 2efe47c016
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
5 changed files with 48 additions and 42 deletions

View file

@ -126,6 +126,9 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
$scope.rateDate = res.fetchedOn;
$scope.rateStr = res.rate + ' ' + $scope.alternativeIsoCode;
$scope.alternativeAmountStr = $filter('formatFiatAmount')(alternativeAmountBtc * res.rate) + ' ' + $scope.alternativeIsoCode;
$timeout(function() {
$scope.$apply();
});
}
});
};

View file

@ -7,6 +7,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
var isGlidera = $scope.isGlidera;
var GLIDERA_LOCK_TIME = 6 * 60 * 60;
var now = Math.floor(Date.now() / 1000);
var countDown;
$scope.init = function() {
$scope.loading = null;
@ -18,6 +19,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.data = {};
initActionList();
checkPaypro();
}
function initActionList() {
@ -53,8 +55,6 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.sign();
});
checkPaypro();
// ToDo: use tx.customData instead of tx.message
if (tx.message === 'Glidera transaction' && isGlidera) {
tx.isGlidera = true;
@ -154,7 +154,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.paymentExpired = false;
setExpirationTime();
self.countDown = $interval(function() {
countDown = $interval(function() {
setExpirationTime();
}, 1000);
@ -162,7 +162,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
var now = Math.floor(Date.now() / 1000);
if (now > expirationTime) {
$scope.paymentExpired = true;
if (self.countDown) $interval.cancel(self.countDown);
if (countDown) $interval.cancel(countDown);
return;
}
var totalSecs = expirationTime - now;