Caching txs

This commit is contained in:
Gustavo Maximiliano Cortez 2017-02-15 12:20:36 -03:00
commit 48e921e7df
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
5 changed files with 59 additions and 34 deletions

View file

@ -1,10 +1,12 @@
'use strict';
angular.module('copayApp.controllers').controller('buyGlideraController', function($scope, $log, $state, $timeout, $ionicHistory, lodash, glideraService, popupService, profileService, ongoingProcess, walletService) {
angular.module('copayApp.controllers').controller('buyGlideraController', function($scope, $log, $state, $timeout, $ionicHistory, lodash, glideraService, popupService, profileService, ongoingProcess, walletService, platformInfo) {
var amount;
var currency;
$scope.isCordova = platformInfo.isCordova;
var showErrorAndBack = function(err) {
$scope.sendStatus = '';
$log.error(err);

View file

@ -13,14 +13,7 @@ angular.module('copayApp.controllers').controller('glideraController',
$scope.account['token'] = data.token;
$scope.account['status'] = data.status;
$scope.account['price'] = {};
glideraService.buyPrice($scope.account.token, {qty: 1}, function(err, buy) {
$scope.account.price['buy'] = buy.price;
});
glideraService.sellPrice($scope.account.token, {qty: 1}, function(err, sell) {
$scope.account.price['sell'] = sell.price;
});
$scope.account['txs'] = data.txs;
$timeout(function() {
$scope.$digest();
@ -46,6 +39,8 @@ angular.module('copayApp.controllers').controller('glideraController',
popupService.showAlert('Authorisation error', err);
return;
}
$scope.account['token'] = data.token;
$scope.account['status'] = data.status;
init();
});
};

View file

@ -1,10 +1,12 @@
'use strict';
angular.module('copayApp.controllers').controller('sellGlideraController', function($scope, $log, $state, $timeout, $ionicHistory, lodash, glideraService, popupService, profileService, ongoingProcess, walletService, configService) {
angular.module('copayApp.controllers').controller('sellGlideraController', function($scope, $log, $state, $timeout, $ionicHistory, lodash, glideraService, popupService, profileService, ongoingProcess, walletService, configService, platformInfo) {
var amount;
var currency;
$scope.isCordova = platformInfo.isCordova;
var showErrorAndBack = function(err) {
$scope.sendStatus = '';
$log.error(err);