switch between wallets in profile working
This commit is contained in:
parent
ff44897922
commit
ac491d10b0
19 changed files with 293 additions and 179 deletions
|
|
@ -12,7 +12,7 @@ function Profile(info, storage) {
|
|||
|
||||
this.hash = info.hash;
|
||||
this.email = info.email;
|
||||
this.extra = info.extra;
|
||||
this.extra = info.extra || {};
|
||||
this.walletInfos = info.walletInfos || {};
|
||||
|
||||
this.key = Profile.key(this.hash);
|
||||
|
|
@ -69,7 +69,7 @@ Profile.prototype.getWallet = function(walletId, cb) {
|
|||
|
||||
Profile.prototype.listWallets = function(opts, cb) {
|
||||
return _.sortBy(this.walletInfos, function(winfo) {
|
||||
return winfo.lastOpenedTs || winfo.createdTs;
|
||||
return -winfo.lastOpenedTs || -winfo.createdTs;
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -141,4 +141,9 @@ Profile.prototype.store = function(opts, cb) {
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
Profile.prototype.getName = function() {
|
||||
return this.extra.nickname || this.email;
|
||||
};
|
||||
|
||||
module.exports = Profile;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue