"has no funds" case

This commit is contained in:
Sebastiaan Pasma 2018-07-23 14:20:46 +02:00
commit 893dbe5c6f
No known key found for this signature in database
GPG key ID: 9A2B0C8B95A1D26F
4 changed files with 103 additions and 21 deletions

View file

@ -1,14 +1,23 @@
'use strict';
angular.module('copayApp.controllers').controller('walletToWalletController', function($scope, $rootScope, $log, profileService, configService) {
// TODO: change according to which screen this is, origin/destination
$scope.headerTitle = gettextCatalog.getString('Choose your origin wallet');
$scope.headerSubtitle = gettextCatalog.getString('This is where the Bitcoin will be taken out from.');
angular.module('copayApp.controllers').controller('walletToWalletController', function($scope, $rootScope, $log, configService, gettextCatalog, profileService) {
$scope.$on("$ionicView.enter", function(event, data) {
$scope.walletsBch = profileService.getWallets({coin: 'bch'});
$scope.walletsBtc = profileService.getWallets({coin: 'btc'});
$scope.type = 'origin';
$scope.coin = 'bch';
$scope.walletsEmpty = [];
$scope.isPaymentRequest = true;
if ($scope.type === 'origin') {
$scope.headerTitle = gettextCatalog.getString('Choose a wallet to send from');
$scope.walletsEmpty = profileService.getWallets({coin: $scope.coin, hasNoFunds: true});
} else if ($scope.type === 'destination') {
$scope.headerTitle = gettextCatalog.getString('Choose a wallet to send to');
}
$scope.walletsBch = profileService.getWallets({coin: 'bch', hasFunds: $scope.type==='origin'});
$scope.walletsBtc = profileService.getWallets({coin: 'btc', hasFunds: $scope.type==='origin'});
configService.whenAvailable(function(config) {
$scope.selectedPriceDisplay = config.wallet.settings.priceDisplay;
});
@ -17,5 +26,4 @@ angular.module('copayApp.controllers').controller('walletToWalletController', fu
$scope.useWallet = function(wallet) {
// Do something with selected wallet
};
});