Transitioning from the Shapeshift screen.
This commit is contained in:
parent
da853bcbf6
commit
7669ab2479
1 changed files with 22 additions and 1 deletions
|
|
@ -1,6 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('shapeshiftController', function($scope, $interval, profileService, walletService, popupService, lodash, $ionicNavBarDelegate) {
|
angular.module('copayApp.controllers').controller('shapeshiftController', function($scope, $interval, profileService, walletService, popupService, lodash, $ionicNavBarDelegate) {
|
||||||
|
var vm = this;
|
||||||
|
|
||||||
|
//vm.buyBitcion = buyBitcoin;
|
||||||
|
|
||||||
var walletsBtc = [];
|
var walletsBtc = [];
|
||||||
var walletsBch = [];
|
var walletsBch = [];
|
||||||
|
|
@ -21,6 +24,12 @@ angular.module('copayApp.controllers').controller('shapeshiftController', functi
|
||||||
$scope.singleToWallet = $scope.toWallets.length == 1;
|
$scope.singleToWallet = $scope.toWallets.length == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buyBitcoin() {
|
||||||
|
console.log('buyBitcoin()');
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.buyBitcoin = buyBitcoin;
|
||||||
|
|
||||||
$scope.onFromWalletSelect = function(wallet) {
|
$scope.onFromWalletSelect = function(wallet) {
|
||||||
$scope.fromWallet = wallet;
|
$scope.fromWallet = wallet;
|
||||||
showToWallets();
|
showToWallets();
|
||||||
|
|
@ -37,12 +46,24 @@ angular.module('copayApp.controllers').controller('shapeshiftController', functi
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||||
|
console.log('beforeEnter()');
|
||||||
walletsBtc = profileService.getWallets({coin: 'btc'});
|
walletsBtc = profileService.getWallets({coin: 'btc'});
|
||||||
walletsBch = profileService.getWallets({coin: 'bch'});
|
walletsBch = profileService.getWallets({coin: 'bch'});
|
||||||
$scope.fromWallets = lodash.filter(walletsBtc.concat(walletsBch), function(w) {
|
$scope.fromWallets = lodash.filter(walletsBtc.concat(walletsBch), function(w) {
|
||||||
return w.status.balance.availableAmount > 0;
|
return w.status.balance.availableAmount > 0;
|
||||||
});
|
});
|
||||||
if ($scope.fromWallets.length == 0) return;
|
console.log('Checking wallets.');
|
||||||
|
if ($scope.fromWallets.length == 0) {
|
||||||
|
// Need to go to new origin screen here, with parameters
|
||||||
|
var params = {
|
||||||
|
thirdParty: {
|
||||||
|
id: 'shapeshift'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
console.log('Asking for transition');
|
||||||
|
$state.transitionTo('tabs.send', params);
|
||||||
|
return
|
||||||
|
}
|
||||||
$scope.onFromWalletSelect($scope.fromWallets[0]);
|
$scope.onFromWalletSelect($scope.fromWallets[0]);
|
||||||
$scope.onToWalletSelect($scope.toWallets[0]);
|
$scope.onToWalletSelect($scope.toWallets[0]);
|
||||||
$scope.singleFromWallet = $scope.fromWallets.length == 1;
|
$scope.singleFromWallet = $scope.fromWallets.length == 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue