fix walletID list

This commit is contained in:
Matias Alejo Garcia 2014-04-17 12:58:54 -03:00
commit a51ed6c66d
3 changed files with 8 additions and 3 deletions

View file

@ -54,13 +54,17 @@ Storage.prototype.remove = function(walletId, k) {
Storage.prototype.getWalletIds = function() {
var walletIds = [];
var uniq = {};
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var split = key.split('::');
if (split.length == 2) {
var walletId = split[0];
walletIds.push(walletId);
if (typeof uniq[walletId] === 'undefined' ) {
walletIds.push(walletId);
uniq[walletId] = 1;
}
}
}