added loading for connecting to shapeshift

This commit is contained in:
Kadir Sekha 2017-12-14 15:01:09 +09:00
commit 1c7c8c5839
2 changed files with 9 additions and 5 deletions

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.directives').directive('shapeshiftCoinTrader', function($interval, shapeshiftApiService, profileService, incomingData) { angular.module('copayApp.directives').directive('shapeshiftCoinTrader', function($interval, shapeshiftApiService, profileService, incomingData, ongoingProcess) {
return { return {
restrict: 'E', restrict: 'E',
transclude: true, transclude: true,
@ -58,6 +58,7 @@ angular.module('copayApp.directives').directive('shapeshiftCoinTrader', function
} }
$scope.shiftIt = function(){ $scope.shiftIt = function(){
ongoingProcess.set('connectingShapeshift', true);
var validate=shapeshiftApiService.ValidateAddress($scope.withdrawalAddress, $scope.coinOut); var validate=shapeshiftApiService.ValidateAddress($scope.withdrawalAddress, $scope.coinOut);
validate.then(function(valid){ validate.then(function(valid){
//console.log($scope.withdrawalAddress) //console.log($scope.withdrawalAddress)
@ -102,12 +103,14 @@ angular.module('copayApp.directives').directive('shapeshiftCoinTrader', function
maxAmount: $scope.marketData.maxLimit maxAmount: $scope.marketData.maxLimit
}; };
if (incomingData.redir(sendAddress, shapeshiftData)) if (incomingData.redir(sendAddress, shapeshiftData)) {
return; ongoingProcess.set('connectingShapeshift', false);
return;
}
$scope.ShiftState = 'Cancel'; /*$scope.ShiftState = 'Cancel';
$scope.GetStatus(); $scope.GetStatus();
$scope.txInterval=$interval($scope.GetStatus, 8000); $scope.txInterval=$interval($scope.GetStatus, 8000);*/
}); });
}) })
}; };

View file

@ -13,6 +13,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
'connectingCoinbase': gettext('Connecting to Coinbase...'), 'connectingCoinbase': gettext('Connecting to Coinbase...'),
'connectingGlidera': gettext('Connecting to Glidera...'), 'connectingGlidera': gettext('Connecting to Glidera...'),
'connectingledger': gettext('Waiting for Ledger...'), 'connectingledger': gettext('Waiting for Ledger...'),
'connectingShapeshift': gettext('Connecting to Shapeshift...'),
'connectingtrezor': gettext('Waiting for Trezor...'), 'connectingtrezor': gettext('Waiting for Trezor...'),
'creatingTx': gettext('Creating transaction'), 'creatingTx': gettext('Creating transaction'),
'creatingWallet': gettext('Creating Wallet...'), 'creatingWallet': gettext('Creating Wallet...'),