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';
angular.module('copayApp.directives').directive('shapeshiftCoinTrader', function($interval, shapeshiftApiService, profileService, incomingData) {
angular.module('copayApp.directives').directive('shapeshiftCoinTrader', function($interval, shapeshiftApiService, profileService, incomingData, ongoingProcess) {
return {
restrict: 'E',
transclude: true,
@ -58,6 +58,7 @@ angular.module('copayApp.directives').directive('shapeshiftCoinTrader', function
}
$scope.shiftIt = function(){
ongoingProcess.set('connectingShapeshift', true);
var validate=shapeshiftApiService.ValidateAddress($scope.withdrawalAddress, $scope.coinOut);
validate.then(function(valid){
//console.log($scope.withdrawalAddress)
@ -102,12 +103,14 @@ angular.module('copayApp.directives').directive('shapeshiftCoinTrader', function
maxAmount: $scope.marketData.maxLimit
};
if (incomingData.redir(sendAddress, shapeshiftData))
return;
if (incomingData.redir(sendAddress, shapeshiftData)) {
ongoingProcess.set('connectingShapeshift', false);
return;
}
$scope.ShiftState = 'Cancel';
/*$scope.ShiftState = 'Cancel';
$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...'),
'connectingGlidera': gettext('Connecting to Glidera...'),
'connectingledger': gettext('Waiting for Ledger...'),
'connectingShapeshift': gettext('Connecting to Shapeshift...'),
'connectingtrezor': gettext('Waiting for Trezor...'),
'creatingTx': gettext('Creating transaction'),
'creatingWallet': gettext('Creating Wallet...'),