Added lastOpened to list of all wallets
This commit is contained in:
parent
be72a2b77a
commit
cfa00590a6
3 changed files with 45 additions and 13 deletions
|
|
@ -23,17 +23,14 @@ angular.module('copayApp.controllers').controller('OpenController', function($sc
|
|||
} else {
|
||||
$scope.retreiving = false;
|
||||
$scope.wallets = wallets.sort(cmp);
|
||||
|
||||
walletFactory.storage.getLastOpened(function(ret) {
|
||||
if (ret && _.indexOf(_.pluck($scope.wallets, 'id')) == -1)
|
||||
ret = null;
|
||||
|
||||
$scope.selectedWalletId = ret || ($scope.wallets[0] && $scope.wallets[0].id);
|
||||
|
||||
setTimeout(function() {
|
||||
$rootScope.$digest();
|
||||
}, 0);
|
||||
var lastOpened = _.findWhere($scope.wallets, {
|
||||
lastOpened: true
|
||||
});
|
||||
$scope.selectedWalletId = lastOpened ? lastOpened.id : ($scope.wallets[0] && $scope.wallets[0].id);
|
||||
|
||||
setTimeout(function() {
|
||||
$rootScope.$digest();
|
||||
}, 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue