make my code work with the latest interface changes
...to Wallet and WalletFactory
This commit is contained in:
parent
5f8deb7d0b
commit
96a6203bb0
7 changed files with 37 additions and 42 deletions
|
|
@ -17,6 +17,9 @@ Storage.prototype.set = function(walletId,v) {
|
|||
Storage.prototype.remove = function(walletId, k) {
|
||||
};
|
||||
|
||||
Storage.prototype.getWalletIds = function() {
|
||||
};
|
||||
|
||||
// remove all values
|
||||
Storage.prototype.clearAll = function() {
|
||||
};
|
||||
|
|
|
|||
|
|
@ -89,6 +89,10 @@ Storage.prototype.remove = function(walletId, k, callback) {
|
|||
this.removeGlobal(this._key(walletId, k), callback);
|
||||
};
|
||||
|
||||
Storage.prototype.getWalletIds = function() {
|
||||
return [];
|
||||
};
|
||||
|
||||
// remove all values
|
||||
Storage.prototype.clearAll = function(callback) {
|
||||
this.data = {};
|
||||
|
|
|
|||
|
|
@ -52,6 +52,21 @@ Storage.prototype.remove = function(walletId, k) {
|
|||
this.removeGlobal(this._key(walletId,k));
|
||||
};
|
||||
|
||||
Storage.prototype.getWalletIds = function() {
|
||||
var walletIds = [];
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
return walletIds;
|
||||
};
|
||||
|
||||
// remove all values
|
||||
Storage.prototype.clearAll = function() {
|
||||
localStorage.clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue