sort wallet list and fix display for unnamed wallets
This commit is contained in:
parent
926bb953bd
commit
c2fb4217ce
2 changed files with 8 additions and 2 deletions
|
|
@ -2,8 +2,13 @@
|
||||||
|
|
||||||
angular.module('copay.signin').controller('SigninController',
|
angular.module('copay.signin').controller('SigninController',
|
||||||
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase) {
|
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase) {
|
||||||
|
var cmp = function(o1, o2){
|
||||||
|
var v1 = o1.show.toLowerCase(), v2 = o2.show.toLowerCase();
|
||||||
|
return v1 > v2 ? 1 : ( v1 < v2 ) ? -1 : 0;
|
||||||
|
};
|
||||||
|
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
$scope.wallets = walletFactory.getWallets();
|
$scope.wallets = walletFactory.getWallets().sort(cmp);
|
||||||
$scope.selectedWalletId = $scope.wallets.length ? $scope.wallets[0].id : null;
|
$scope.selectedWalletId = $scope.wallets.length ? $scope.wallets[0].id : null;
|
||||||
$scope.openPassword = '';
|
$scope.openPassword = '';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,8 @@ Storage.prototype._write = function(k,v) {
|
||||||
|
|
||||||
// get value by key
|
// get value by key
|
||||||
Storage.prototype.getGlobal = function(k) {
|
Storage.prototype.getGlobal = function(k) {
|
||||||
return localStorage.getItem(k);
|
var item = localStorage.getItem(k);
|
||||||
|
return item == 'undefined' ? undefined : item;
|
||||||
};
|
};
|
||||||
|
|
||||||
// set value for key
|
// set value for key
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue