processes names refactor

This commit is contained in:
Gabriel Bazán 2016-12-23 12:10:19 -03:00
commit 4d63fc71bd
4 changed files with 14 additions and 14 deletions

View file

@ -34,11 +34,11 @@ angular.module('copayApp.controllers').controller('amazonController',
}; };
$scope.updatePendingGiftCards = lodash.debounce(function() { $scope.updatePendingGiftCards = lodash.debounce(function() {
ongoingProcess.set('updateGiftCards', true); ongoingProcess.set('updatingGiftCards', true);
amazonService.getPendingGiftCards(function(err, gcds) { amazonService.getPendingGiftCards(function(err, gcds) {
if (lodash.isEmpty(gcds)) { if (lodash.isEmpty(gcds)) {
$timeout(function() { $timeout(function() {
ongoingProcess.set('updateGiftCards', false); ongoingProcess.set('updatingGiftCards', false);
}, 1000); }, 1000);
} }
$timeout(function() { $timeout(function() {
@ -49,7 +49,7 @@ angular.module('copayApp.controllers').controller('amazonController',
lodash.forEach(gcds, function(dataFromStorage) { lodash.forEach(gcds, function(dataFromStorage) {
if (++index == Object.keys(gcds).length) { if (++index == Object.keys(gcds).length) {
$timeout(function() { $timeout(function() {
ongoingProcess.set('updateGiftCards', false); ongoingProcess.set('updatingGiftCards', false);
}, 1000); }, 1000);
} }
if (dataFromStorage.status == 'PENDING') { if (dataFromStorage.status == 'PENDING') {

View file

@ -783,7 +783,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
invoiceUrl: $scope.paypro.url, invoiceUrl: $scope.paypro.url,
invoiceTime: giftCardInvoiceTime invoiceTime: giftCardInvoiceTime
}; };
ongoingProcess.set('createGiftCard', true); ongoingProcess.set('creatingGiftCard', true);
debounceCreate(count, dataSrc, onSendStatusChange); debounceCreate(count, dataSrc, onSendStatusChange);
} }
}, onSendStatusChange); }, onSendStatusChange);
@ -830,7 +830,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
} }
amazonService.savePendingGiftCard(newData, null, function(err) { amazonService.savePendingGiftCard(newData, null, function(err) {
ongoingProcess.set('createGiftCard', false); ongoingProcess.set('creatingGiftCard', false);
$log.debug("Saving new gift card with status: " + newData.status); $log.debug("Saving new gift card with status: " + newData.status);
$scope.amazonGiftCard = newData; $scope.amazonGiftCard = newData;
}); });

View file

@ -3,9 +3,9 @@
angular.module('copayApp.controllers').controller('amazonCardDetailsController', function($scope, $log, $timeout, $ionicScrollDelegate, bwcError, amazonService, lodash, ongoingProcess, popupService, externalLinkService) { angular.module('copayApp.controllers').controller('amazonCardDetailsController', function($scope, $log, $timeout, $ionicScrollDelegate, bwcError, amazonService, lodash, ongoingProcess, popupService, externalLinkService) {
$scope.cancelGiftCard = function() { $scope.cancelGiftCard = function() {
ongoingProcess.set('cancelGiftCard', true); ongoingProcess.set('cancelingGiftCard', true);
amazonService.cancelGiftCard($scope.card, function(err, data) { amazonService.cancelGiftCard($scope.card, function(err, data) {
ongoingProcess.set('cancelGiftCard', false); ongoingProcess.set('cancelingGiftCard', false);
if (err) { if (err) {
popupService.showAlert('Error', bwcError.msg(err)); popupService.showAlert('Error', bwcError.msg(err));
return; return;
@ -30,11 +30,11 @@ angular.module('copayApp.controllers').controller('amazonCardDetailsController',
}; };
$scope.refreshGiftCard = function() { $scope.refreshGiftCard = function() {
ongoingProcess.set('updateGiftCard', true); ongoingProcess.set('updatingGiftCard', true);
amazonService.getPendingGiftCards(function(err, gcds) { amazonService.getPendingGiftCards(function(err, gcds) {
if (lodash.isEmpty(gcds)) { if (lodash.isEmpty(gcds)) {
$timeout(function() { $timeout(function() {
ongoingProcess.set('updateGiftCard', false); ongoingProcess.set('updatingGiftCard', false);
}, 1000); }, 1000);
} }
if (err) { if (err) {
@ -45,7 +45,7 @@ angular.module('copayApp.controllers').controller('amazonCardDetailsController',
lodash.forEach(gcds, function(dataFromStorage) { lodash.forEach(gcds, function(dataFromStorage) {
if (++index == Object.keys(gcds).length) { if (++index == Object.keys(gcds).length) {
$timeout(function() { $timeout(function() {
ongoingProcess.set('updateGiftCard', false); ongoingProcess.set('updatingGiftCard', false);
}, 1000); }, 1000);
} }
if (dataFromStorage.status == 'PENDING' && dataFromStorage.invoiceId == $scope.card.invoiceId) { if (dataFromStorage.status == 'PENDING' && dataFromStorage.invoiceId == $scope.card.invoiceId) {

View file

@ -40,10 +40,10 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
'sending2faCode': gettext('Sending 2FA code...'), 'sending2faCode': gettext('Sending 2FA code...'),
'buyingBitcoin': gettext('Buying Bitcoin...'), 'buyingBitcoin': gettext('Buying Bitcoin...'),
'sellingBitcoin': gettext('Selling Bitcoin...'), 'sellingBitcoin': gettext('Selling Bitcoin...'),
'updateGiftCards': 'Updating Gift Cards...', 'updatingGiftCards': 'Updating Gift Cards...',
'updateGiftCard': 'Updating Gift Card...', 'updatingGiftCard': 'Updating Gift Card...',
'cancelGiftCard': 'Canceling Gift Card...', 'cancelingGiftCard': 'Canceling Gift Card...',
'createGiftCard': 'Creating Gift Card...' 'creatingGiftCard': 'Creating Gift Card...'
}; };
root.clear = function() { root.clear = function() {