add sessionStorage param

This commit is contained in:
Matias Alejo Garcia 2014-08-15 10:26:31 -04:00
commit 54bc98f0bd
3 changed files with 283 additions and 6 deletions

View file

@ -168,6 +168,7 @@ WalletFactory.prototype._checkNetwork = function(inNetworkName) {
}
};
WalletFactory.prototype.open = function(walletId, passphrase) {
this.storage._setPassphrase(passphrase);
var w = this.read(walletId);

View file

@ -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') {