handle 0 wallets
This commit is contained in:
parent
22c378b080
commit
43c0eb9cb6
5 changed files with 23 additions and 23 deletions
|
|
@ -65,7 +65,7 @@
|
|||
class="sidebar"
|
||||
ng-if="$root.iden"></div>
|
||||
|
||||
<section ng-class="{'main' : $root.iden && $root.iden.listWallets().length>0}" ng-view></section>
|
||||
<section ng-class="{'main' : $root.iden && $root.iden.listWallets().length>=0}" ng-view></section>
|
||||
|
||||
<a class="exit-off-canvas"></a>
|
||||
|
||||
|
|
|
|||
|
|
@ -190,9 +190,8 @@ Identity.open = function(email, password, opts, cb) {
|
|||
iden.profile = profile;
|
||||
|
||||
var wids = _.pluck(iden.listWallets(), 'id');
|
||||
|
||||
if (!wids || !wids.length)
|
||||
return new Error('Could not open any wallet from profile');
|
||||
return cb(new Error('Could not open any wallet from profile'), iden);
|
||||
|
||||
// Open All wallets from profile
|
||||
//This could be optional, or opts.onlyOpen = wid
|
||||
|
|
|
|||
|
|
@ -217,10 +217,13 @@ angular.module('copayApp.services')
|
|||
};
|
||||
|
||||
root.bindProfile = function($scope, iden, w) {
|
||||
|
||||
root.setupGlobalVariables(iden);
|
||||
root.rebindWallets($scope, iden);
|
||||
if (w) {
|
||||
root.setFocusedWallet(w);
|
||||
} else {
|
||||
$location.path('/manage');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
|
||||
<ul class="side-nav">
|
||||
|
||||
<li data-ng-repeat="item in $root.iden.listWallets() track by $index" class="nav-item db p20h">
|
||||
<a ng-click="switchWallet(item.id)" ng-if="item.id != $root.wallet.id "> <i class="size-21 m20r fi-bitcoin-circle"></i> {{item.name || item.id}}</a>
|
||||
<div ng-if="item.id == $root.wallet.id ">
|
||||
|
|
@ -56,7 +55,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="nav-item" ui-route="{{create}}">
|
||||
<a href="#!/manage" class="db p20h" title="Create"><i class="size-21 m20r fi-plus"></i> {{'Manage Wallets' | translate }} </a>
|
||||
|
|
@ -71,4 +70,3 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue