add sessionStorage param
This commit is contained in:
parent
eb9acb958f
commit
54bc98f0bd
3 changed files with 283 additions and 6 deletions
|
|
@ -168,6 +168,7 @@ WalletFactory.prototype._checkNetwork = function(inNetworkName) {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
WalletFactory.prototype.open = function(walletId, passphrase) {
|
||||
this.storage._setPassphrase(passphrase);
|
||||
var w = this.read(walletId);
|
||||
|
|
|
|||
|
|
@ -11,11 +11,15 @@ function Storage(opts) {
|
|||
if (opts.password)
|
||||
this._setPassphrase(opts.password);
|
||||
|
||||
if (opts.localStorage) {
|
||||
this.localStorage = opts.localStorage;
|
||||
} else if (localStorage) {
|
||||
this.localStorage = localStorage;
|
||||
}
|
||||
try{
|
||||
this.localStorage = opts.localStorage || localStorage;
|
||||
this.sessionStorage = opts.sessionStorage || sessionStorage;
|
||||
} catch (e) {};
|
||||
|
||||
if (!this.localStorage)
|
||||
throw new Error('no localStorage');
|
||||
if (!this.sessionStorage)
|
||||
throw new Error('no sessionStorage');
|
||||
}
|
||||
|
||||
var pps = {};
|
||||
|
|
@ -141,7 +145,7 @@ Storage.prototype.getWalletIds = function() {
|
|||
if (split.length == 2) {
|
||||
var walletId = split[0];
|
||||
|
||||
if (!walletId || walletId === 'nameFor')
|
||||
if (!walletId || walletId === 'nameFor' || walletId ==='lock')
|
||||
continue;
|
||||
|
||||
if (typeof uniq[walletId] === 'undefined') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue