processes names refactor
This commit is contained in:
parent
3bef5ce7ff
commit
4d63fc71bd
4 changed files with 14 additions and 14 deletions
|
|
@ -34,11 +34,11 @@ angular.module('copayApp.controllers').controller('amazonController',
|
|||
};
|
||||
|
||||
$scope.updatePendingGiftCards = lodash.debounce(function() {
|
||||
ongoingProcess.set('updateGiftCards', true);
|
||||
ongoingProcess.set('updatingGiftCards', true);
|
||||
amazonService.getPendingGiftCards(function(err, gcds) {
|
||||
if (lodash.isEmpty(gcds)) {
|
||||
$timeout(function() {
|
||||
ongoingProcess.set('updateGiftCards', false);
|
||||
ongoingProcess.set('updatingGiftCards', false);
|
||||
}, 1000);
|
||||
}
|
||||
$timeout(function() {
|
||||
|
|
@ -49,7 +49,7 @@ angular.module('copayApp.controllers').controller('amazonController',
|
|||
lodash.forEach(gcds, function(dataFromStorage) {
|
||||
if (++index == Object.keys(gcds).length) {
|
||||
$timeout(function() {
|
||||
ongoingProcess.set('updateGiftCards', false);
|
||||
ongoingProcess.set('updatingGiftCards', false);
|
||||
}, 1000);
|
||||
}
|
||||
if (dataFromStorage.status == 'PENDING') {
|
||||
|
|
|
|||
|
|
@ -783,7 +783,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
invoiceUrl: $scope.paypro.url,
|
||||
invoiceTime: giftCardInvoiceTime
|
||||
};
|
||||
ongoingProcess.set('createGiftCard', true);
|
||||
ongoingProcess.set('creatingGiftCard', true);
|
||||
debounceCreate(count, dataSrc, onSendStatusChange);
|
||||
}
|
||||
}, onSendStatusChange);
|
||||
|
|
@ -830,7 +830,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
}
|
||||
|
||||
amazonService.savePendingGiftCard(newData, null, function(err) {
|
||||
ongoingProcess.set('createGiftCard', false);
|
||||
ongoingProcess.set('creatingGiftCard', false);
|
||||
$log.debug("Saving new gift card with status: " + newData.status);
|
||||
$scope.amazonGiftCard = newData;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
angular.module('copayApp.controllers').controller('amazonCardDetailsController', function($scope, $log, $timeout, $ionicScrollDelegate, bwcError, amazonService, lodash, ongoingProcess, popupService, externalLinkService) {
|
||||
|
||||
$scope.cancelGiftCard = function() {
|
||||
ongoingProcess.set('cancelGiftCard', true);
|
||||
ongoingProcess.set('cancelingGiftCard', true);
|
||||
amazonService.cancelGiftCard($scope.card, function(err, data) {
|
||||
ongoingProcess.set('cancelGiftCard', false);
|
||||
ongoingProcess.set('cancelingGiftCard', false);
|
||||
if (err) {
|
||||
popupService.showAlert('Error', bwcError.msg(err));
|
||||
return;
|
||||
|
|
@ -30,11 +30,11 @@ angular.module('copayApp.controllers').controller('amazonCardDetailsController',
|
|||
};
|
||||
|
||||
$scope.refreshGiftCard = function() {
|
||||
ongoingProcess.set('updateGiftCard', true);
|
||||
ongoingProcess.set('updatingGiftCard', true);
|
||||
amazonService.getPendingGiftCards(function(err, gcds) {
|
||||
if (lodash.isEmpty(gcds)) {
|
||||
$timeout(function() {
|
||||
ongoingProcess.set('updateGiftCard', false);
|
||||
ongoingProcess.set('updatingGiftCard', false);
|
||||
}, 1000);
|
||||
}
|
||||
if (err) {
|
||||
|
|
@ -45,7 +45,7 @@ angular.module('copayApp.controllers').controller('amazonCardDetailsController',
|
|||
lodash.forEach(gcds, function(dataFromStorage) {
|
||||
if (++index == Object.keys(gcds).length) {
|
||||
$timeout(function() {
|
||||
ongoingProcess.set('updateGiftCard', false);
|
||||
ongoingProcess.set('updatingGiftCard', false);
|
||||
}, 1000);
|
||||
}
|
||||
if (dataFromStorage.status == 'PENDING' && dataFromStorage.invoiceId == $scope.card.invoiceId) {
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
|
|||
'sending2faCode': gettext('Sending 2FA code...'),
|
||||
'buyingBitcoin': gettext('Buying Bitcoin...'),
|
||||
'sellingBitcoin': gettext('Selling Bitcoin...'),
|
||||
'updateGiftCards': 'Updating Gift Cards...',
|
||||
'updateGiftCard': 'Updating Gift Card...',
|
||||
'cancelGiftCard': 'Canceling Gift Card...',
|
||||
'createGiftCard': 'Creating Gift Card...'
|
||||
'updatingGiftCards': 'Updating Gift Cards...',
|
||||
'updatingGiftCard': 'Updating Gift Card...',
|
||||
'cancelingGiftCard': 'Canceling Gift Card...',
|
||||
'creatingGiftCard': 'Creating Gift Card...'
|
||||
};
|
||||
|
||||
root.clear = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue