Split wallets by type (bitcoin and bitcoin cash)
This commit is contained in:
parent
cc403fe034
commit
a853c17a0d
7 changed files with 76 additions and 41 deletions
|
|
@ -28,7 +28,7 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
$scope.formData.bwsurl = defaults.bws.url;
|
$scope.formData.bwsurl = defaults.bws.url;
|
||||||
$scope.TCValues = lodash.range(2, defaults.limits.totalCopayers + 1);
|
$scope.TCValues = lodash.range(2, defaults.limits.totalCopayers + 1);
|
||||||
$scope.formData.derivationPath = derivationPathHelper.default;
|
$scope.formData.derivationPath = derivationPathHelper.default;
|
||||||
$scope.formData.coin = 'btc';
|
$scope.formData.coin = data.stateParams.coin;
|
||||||
|
|
||||||
if (config.cashSupport) $scope.enableCash = true;
|
if (config.cashSupport) $scope.enableCash = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ angular.module('copayApp.controllers').controller('importController',
|
||||||
$scope.formData.bwsurl = defaults.bws.url;
|
$scope.formData.bwsurl = defaults.bws.url;
|
||||||
$scope.formData.derivationPath = derivationPathHelper.default;
|
$scope.formData.derivationPath = derivationPathHelper.default;
|
||||||
$scope.formData.account = 1;
|
$scope.formData.account = 1;
|
||||||
$scope.formData.coin = 'btc';
|
$scope.formData.coin = $stateParams.coin;
|
||||||
$scope.importErr = false;
|
$scope.importErr = false;
|
||||||
$scope.isCopay = appConfigService.name == 'copay';
|
$scope.isCopay = appConfigService.name == 'copay';
|
||||||
$scope.fromHardwareWallet = {
|
$scope.fromHardwareWallet = {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
$scope.formData.derivationPath = derivationPathHelper.default;
|
$scope.formData.derivationPath = derivationPathHelper.default;
|
||||||
$scope.formData.account = 1;
|
$scope.formData.account = 1;
|
||||||
$scope.formData.secret = null;
|
$scope.formData.secret = null;
|
||||||
$scope.formData.coin = 'btc';
|
$scope.formData.coin = data.stateParams.coin;
|
||||||
if (config.cashSupport) $scope.enableCash = true;
|
if (config.cashSupport) $scope.enableCash = true;
|
||||||
resetPasswordFields();
|
resetPasswordFields();
|
||||||
updateSeedSourceSelect();
|
updateSeedSourceSelect();
|
||||||
|
|
|
||||||
|
|
@ -206,14 +206,24 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
};
|
};
|
||||||
|
|
||||||
var updateAllWallets = function() {
|
var updateAllWallets = function() {
|
||||||
$scope.wallets = profileService.getWallets();
|
var wallets = [];
|
||||||
if (lodash.isEmpty($scope.wallets)) return;
|
$scope.walletsBtc = profileService.getWallets({coin: 'btc'});
|
||||||
|
$scope.walletsBch = profileService.getWallets({coin: 'bch'});
|
||||||
|
|
||||||
var i = $scope.wallets.length;
|
lodash.each($scope.walletsBtc, function(wBtc) {
|
||||||
|
wallets.push(wBtc);
|
||||||
|
});
|
||||||
|
|
||||||
|
lodash.each($scope.walletsBch, function(wBch) {
|
||||||
|
wallets.push(wBch);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (lodash.isEmpty(wallets)) return;
|
||||||
|
|
||||||
|
var i = wallets.length;
|
||||||
var j = 0;
|
var j = 0;
|
||||||
var timeSpan = 60 * 60 * 24 * 7;
|
|
||||||
|
|
||||||
lodash.each($scope.wallets, function(wallet) {
|
lodash.each(wallets, function(wallet) {
|
||||||
walletService.getStatus(wallet, {}, function(err, status) {
|
walletService.getStatus(wallet, {}, function(err, status) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -329,6 +329,9 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
'tab-home@tabs': {
|
'tab-home@tabs': {
|
||||||
templateUrl: 'views/add.html'
|
templateUrl: 'views/add.html'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
coin: 'btc'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.state('tabs.add.join', {
|
.state('tabs.add.join', {
|
||||||
|
|
|
||||||
22
www/views/includes/walletList.html
Normal file
22
www/views/includes/walletList.html
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
<i class="icon big-icon-svg" ng-include="'views/includes/walletIcon.html'"></i>
|
||||||
|
<span>
|
||||||
|
{{wallet.name || wallet.id}}
|
||||||
|
</span>
|
||||||
|
<p>
|
||||||
|
<span ng-if="!wallet.isComplete()" class="assertive" translate>
|
||||||
|
Incomplete
|
||||||
|
</span>
|
||||||
|
<span ng-if="wallet.isComplete()">
|
||||||
|
<span ng-if="!wallet.balanceHidden && !wallet.scanning"> {{wallet.status.totalBalanceStr ? wallet.status.totalBalanceStr : ( wallet.cachedBalance ? wallet.cachedBalance + (wallet.cachedBalanceUpdatedOn ? ' · ' + ( wallet.cachedBalanceUpdatedOn * 1000 | amTimeAgo) : '') : '' ) }} </span>
|
||||||
|
<span ng-if="wallet.scanning" translate> Scanning funds... </span>
|
||||||
|
|
||||||
|
<span ng-if="wallet.balanceHidden && !wallet.scanning" translate>[Balance Hidden]</span>
|
||||||
|
<span class="tab-home__wallet__multisig-number" ng-if="wallet.n > 1">
|
||||||
|
{{wallet.m}}-of-{{wallet.n}}
|
||||||
|
</span>
|
||||||
|
<i ng-if="!wallet.balanceHidden && (wallet.status.totalBalanceSat != wallet.status.spendableAmount)" class="tab-home__wallet__status-icon ion-ios-timer-outline"></i>
|
||||||
|
<span class="assertive" ng-if="wallet.error">{{wallet.error}}</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
<i class="icon bp-arrow-right"></i>
|
||||||
|
|
@ -64,49 +64,49 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="list card">
|
<div class="list card" ng-if="!walletsBtc[0] && !walletsBch[0]">
|
||||||
<div class="item item-icon-right item-heading">
|
<div class="item item-icon-right item-heading">
|
||||||
<span translate>Wallets</span>
|
<span translate>Wallets</span>
|
||||||
<a ui-sref="tabs.add" ng-if="wallets[0]"><i class="icon ion-ios-plus-empty list-add-button"></i></a>
|
</div>
|
||||||
|
<a ui-sref="tabs.add" class="item item-icon-left item-big-icon-left item-icon-right next-step">
|
||||||
|
<i class="icon big-icon-svg">
|
||||||
|
<img src="img/icon-wallet.svg" class="bg wallet icon-create-wallet"/>
|
||||||
|
</i>
|
||||||
|
<span translate>Create bitcoin wallet</span>
|
||||||
|
<i class="icon bp-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="list card" ng-if="walletsBtc[0]">
|
||||||
|
<div class="item item-icon-right item-heading">
|
||||||
|
<span translate>Bitcoin Wallets</span>
|
||||||
|
<a ui-sref="tabs.add"><i class="icon ion-ios-plus-empty list-add-button"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a ng-if="!wallets[0]" ui-sref="tabs.add" class="item item-icon-left item-big-icon-left item-icon-right next-step">
|
<a ng-repeat="wallet in walletsBtc track by $index"
|
||||||
<i class="icon big-icon-svg">
|
|
||||||
<img src="img/icon-wallet.svg" class="bg wallet icon-create-wallet"/>
|
|
||||||
</i>
|
|
||||||
<span translate>Create bitcoin wallet</span>
|
|
||||||
<i class="icon bp-arrow-right"></i>
|
|
||||||
</a>
|
|
||||||
<a ng-repeat="wallet in wallets track by $index"
|
|
||||||
class="item item-sub item-icon-left item-big-icon-left item-icon-right wallet"
|
class="item item-sub item-icon-left item-big-icon-left item-icon-right wallet"
|
||||||
ng-click="openWallet(wallet)">
|
ng-click="openWallet(wallet)">
|
||||||
<i class="icon big-icon-svg" ng-include="'views/includes/walletIcon.html'"></i>
|
<span ng-include="'views/includes/walletList.html'"></span>
|
||||||
<span>
|
|
||||||
{{wallet.name || wallet.id}}
|
|
||||||
</span>
|
|
||||||
<p>
|
|
||||||
<span ng-if="!wallet.isComplete()" class="assertive" translate>
|
|
||||||
Incomplete
|
|
||||||
</span>
|
|
||||||
<span ng-if="wallet.isComplete()">
|
|
||||||
<span ng-if="!wallet.balanceHidden && !wallet.scanning"> {{wallet.status.totalBalanceStr ? wallet.status.totalBalanceStr : ( wallet.cachedBalance ? wallet.cachedBalance + (wallet.cachedBalanceUpdatedOn ? ' · ' + ( wallet.cachedBalanceUpdatedOn * 1000 | amTimeAgo) : '') : '' ) }} </span>
|
|
||||||
<span ng-if="wallet.scanning" translate> Scanning funds... </span>
|
|
||||||
|
|
||||||
<span ng-if="wallet.balanceHidden && !wallet.scanning" translate>[Balance Hidden]</span>
|
|
||||||
<span class="tab-home__wallet__multisig-number" ng-if="wallet.n > 1">
|
|
||||||
{{wallet.m}}-of-{{wallet.n}}
|
|
||||||
</span>
|
|
||||||
<i ng-if="!wallet.balanceHidden && (wallet.status.totalBalanceSat != wallet.status.spendableAmount)" class="tab-home__wallet__status-icon ion-ios-timer-outline"></i>
|
|
||||||
<span class="assertive" ng-if="wallet.error">{{wallet.error}}</span>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<i class="icon bp-arrow-right"></i>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ng-hide list card" ng-show="wallets[0] && bitpayCardItems.length>0" ng-include="'views/includes/bitpayCardsCard.html'"></div>
|
|
||||||
<div class="ng-hide list card" ng-show="wallets[0] && buyAndSellItems.length>0" ng-include="'views/includes/buyAndSellCard.html'"></div>
|
<div class="list card" ng-if="walletsBch[0]">
|
||||||
|
<div class="item item-icon-right item-heading">
|
||||||
|
<span translate>Bitcoin Cash Wallets</span>
|
||||||
|
<a ui-sref="tabs.add({coin:'bch'})"><i class="icon ion-ios-plus-empty list-add-button"></i></a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a ng-repeat="wallet in walletsBch track by $index"
|
||||||
|
class="item item-sub item-icon-left item-big-icon-left item-icon-right wallet"
|
||||||
|
ng-click="openWallet(wallet)">
|
||||||
|
<span ng-include="'views/includes/walletList.html'"></span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ng-hide list card" ng-show="walletsBtc[0] && bitpayCardItems.length>0" ng-include="'views/includes/bitpayCardsCard.html'"></div>
|
||||||
|
<div class="ng-hide list card" ng-show="walletsBtc[0] && buyAndSellItems.length>0" ng-include="'views/includes/buyAndSellCard.html'"></div>
|
||||||
<div class="ng-hide list card" ng-show="homeIntegrations.length>0" ng-include="'views/includes/homeIntegrations.html'"></div>
|
<div class="ng-hide list card" ng-show="homeIntegrations.length>0" ng-include="'views/includes/homeIntegrations.html'"></div>
|
||||||
<div class="ng-hide list card" ng-show="nextStepsItems.length>0 && !isWindowsPhoneApp" ng-include="'views/includes/nextSteps.html'"></div>
|
<div class="ng-hide list card" ng-show="nextStepsItems.length>0 && !isWindowsPhoneApp" ng-include="'views/includes/nextSteps.html'"></div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue