Merge remote-tracking branch 'origin/wallet/task/466' into wallet/task/454
This commit is contained in:
commit
9b27cb50e2
2 changed files with 24 additions and 1 deletions
|
|
@ -1,6 +1,9 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('shapeshiftController', function($scope, $interval, profileService, walletService, popupService, lodash, $ionicNavBarDelegate) {
|
||||
var vm = this;
|
||||
|
||||
//vm.buyBitcion = buyBitcoin;
|
||||
|
||||
var walletsBtc = [];
|
||||
var walletsBch = [];
|
||||
|
|
@ -21,6 +24,12 @@ angular.module('copayApp.controllers').controller('shapeshiftController', functi
|
|||
$scope.singleToWallet = $scope.toWallets.length == 1;
|
||||
}
|
||||
|
||||
function buyBitcoin() {
|
||||
console.log('buyBitcoin()');
|
||||
}
|
||||
|
||||
$scope.buyBitcoin = buyBitcoin;
|
||||
|
||||
$scope.onFromWalletSelect = function(wallet) {
|
||||
$scope.fromWallet = wallet;
|
||||
showToWallets();
|
||||
|
|
@ -37,12 +46,24 @@ angular.module('copayApp.controllers').controller('shapeshiftController', functi
|
|||
}
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
console.log('beforeEnter()');
|
||||
walletsBtc = profileService.getWallets({coin: 'btc'});
|
||||
walletsBch = profileService.getWallets({coin: 'bch'});
|
||||
$scope.fromWallets = lodash.filter(walletsBtc.concat(walletsBch), function(w) {
|
||||
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.onToWalletSelect($scope.toWallets[0]);
|
||||
$scope.singleFromWallet = $scope.fromWallets.length == 1;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
<div class="list card ng-hide" ng-show="fromWallets.length == 0 || toWallets.length == 0">
|
||||
<div class="item item-heading">
|
||||
<span translate>No available wallets to convert between.</span>
|
||||
<button ui-sref="tabs.buyandsell">Buy Bitcoin Now</button>
|
||||
<button ui-sref="tabs.receive">Show my address</button>
|
||||
</div>
|
||||
</div>
|
||||
<shapeshift-coin-trader class="ng-hide" ng-show="fromWallets.length > 0 && toWallets.length > 0">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue