Updates new spinner

This commit is contained in:
Gustavo Maximiliano Cortez 2016-06-13 21:50:48 -03:00
commit 02334320d0
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
5 changed files with 22 additions and 51 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('amazonCardDetailsController', function($scope, $timeout, amazonService) {
angular.module('copayApp.controllers').controller('amazonCardDetailsController', function($scope, $timeout, amazonService, ongoingProcess) {
$scope.cancelGiftCard = function() {
var dataSrc = {
@ -10,9 +10,9 @@ angular.module('copayApp.controllers').controller('amazonCardDetailsController',
bitpayInvoiceUrl: $scope.card.bitpayInvoiceUrl,
date: $scope.card.date
};
$scope.loading = true;
ongoingProcess.set('Canceling gift card...', true);
amazonService.cancelGiftCard(dataSrc, function(err, data) {
$scope.loading = null;
ongoingProcess.set('Canceling gift card...', false);
if (err || data.status != 'SUCCESS') {
$scope.error = err || data.status;
return;
@ -36,9 +36,9 @@ angular.module('copayApp.controllers').controller('amazonCardDetailsController',
bitpayInvoiceUrl: $scope.card.bitpayInvoiceUrl,
date: $scope.card.date
};
$scope.loading = true;
ongoingProcess.set('Updating gift card...', true);
amazonService.createGiftCard(dataSrc, function(err, data) {
$scope.loading = null;
ongoingProcess.set('Updating gift card...', false);
if (err) {
$scope.error = err;
return;