fixed bug where user could send to shapeshift from wrong wallet

This commit is contained in:
Kadir Sekha 2018-01-02 15:38:40 +00:00
commit 64b11fba3a
7 changed files with 31 additions and 3 deletions

View file

@ -13,6 +13,7 @@ angular.module('copayApp.directives').directive('shapeshiftCoinSelector', functi
amount:'=amount',
marketData:'=marketData',
coinAddress:'=coinAddress',
walletId:'=walletId',
direction:'=direction',
},
link: function(scope, element, attrs, controllers) {
@ -35,6 +36,12 @@ angular.module('copayApp.directives').directive('shapeshiftCoinSelector', functi
scope.$watch('amount', function(newVal) {
coinTraderCtrl.amount(newVal)
});
scope.$watch('walletId', function(newVal) {
if(scope.direction === 'in')
coinTraderCtrl.fromWalletId(newVal);
else if(scope.direction === 'out')
coinTraderCtrl.toWalletId(newVal);
});
},
templateUrl: 'views/includes/shapeshift-coin-selector.html'
}