changed address type select to selector and cleaned receive screen

This commit is contained in:
Kadir Sekha 2018-02-21 22:29:44 +05:30
commit fa6a4c2323
2 changed files with 18 additions and 22 deletions

View file

@ -3,7 +3,7 @@
angular.module('copayApp.controllers').controller('tabReceiveController', function($rootScope, $scope, $timeout, $log, $ionicModal, $state, $ionicHistory, $ionicPopover, storageService, platformInfo, walletService, profileService, configService, lodash, gettextCatalog, popupService, bwcError, bitcoinCashJsService) {
var listeners = [];
$scope.bchAddressType = 'cashaddr';
$scope.bchAddressType = { type: 'cashaddr' };
var bchAddresses = {};
$scope.isCordova = platformInfo.isCordova;
@ -30,7 +30,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
if ($scope.wallet.coin == 'bch') {
bchAddresses = bitcoinCashJsService.translateAddresses(addr);
$scope.addr = bchAddresses[$scope.bchAddressType];
$scope.addr = bchAddresses[$scope.bchAddressType.type];
} else {
$scope.addr = addr;
}
@ -42,8 +42,8 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
};
$scope.displayAddress = function(type) {
$scope.bchAddressType = type;
$scope.addr = bchAddresses[$scope.bchAddressType];
$scope.bchAddressType.type = type;
$scope.addr = bchAddresses[$scope.bchAddressType.type];
}
$scope.goCopayers = function() {

View file

@ -31,10 +31,9 @@
<div>
<button ng-show="addr" class="button button-standard button-small" ng-click="requestSpecificAmount()">
<span translate>Request Specific amount</span>
<i class="icon ion-ios-arrow-right"></i>
</button><br/><br/>
</div>
<div copy-to-clipboard="wallet.coin == 'bch' && bchAddressType == 'cashaddr' ? 'bitcoincash:' + addr : addr">
<div copy-to-clipboard="wallet.coin == 'bch' && bchAddressType.type == 'cashaddr' ? 'bitcoincash:' + addr : addr">
<span ng-show="shouldShowReceiveAddressFromHardware()">
<button class="button button-standard button-primary" ng-click="showReceiveAddressFromHardware()">
<span translate>Show address</span>
@ -46,25 +45,22 @@
<ion-spinner ng-show="!addr" class="spinner-dark" icon="crescent"></ion-spinner>
</div>
</div>
<div>
<button ng-show="addr && wallet.coin == 'bch' && bchAddressType != 'cashaddr'" class="button-address" ng-click="displayAddress('cashaddr')">
<span translate>Display new style address</span>
</button>
</div>
<div>
<button ng-show="addr && wallet.coin == 'bch' && bchAddressType != 'legacy'" class="button-address" ng-click="displayAddress('legacy')">
<span translate>Display legacy address</span>
</button>
</div>
<div>
<button ng-show="addr && wallet.coin == 'bch' && bchAddressType != 'bitpay'" class="button-address" ng-click="displayAddress('bitpay')">
<span translate>Display BitPay address</span>
</button>
</div>
<div>
<button ng-show="addr" class="button-address" ng-click="setAddress(true)">
<span translate>Generate new address</span>
</button>
</button><br/>
</div>
<div ng-show="addr && wallet.coin == 'bch'">
<label class="item-input item-select">
<div class="input-label" translate>
Address Type:
</div>
<select ng-model="bchAddressType.type" ng-change="displayAddress(bchAddressType.type)">
<option value="cashaddr">Cash Address</option>
<option value="legacy">Legacy</option>
<option value="bitpay">BitPay</option>
</select>
</label>
</div>
</div>
</article>