refactor wallet seletors in buy/sell controllers

This commit is contained in:
Matias Alejo Garcia 2016-06-11 23:55:28 -03:00
commit 4b0abd77a2
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
9 changed files with 73 additions and 119 deletions

View file

@ -699,7 +699,7 @@ angular.module('copayApp.services')
});
};
root.getWallets = function(network) {
root.getWallets = function(network, n) {
if (!root.profile) return [];
var config = configService.getSync();
@ -721,6 +721,12 @@ angular.module('copayApp.services')
return (w.network == network);
});
}
if (n) {
ret = lodash.filter(ret, function(w) {
return (w.n == n);
});
}
return lodash.sortBy(ret, 'name');
};