mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2026-03-02 23:13:25 +00:00
If you attempt to store an empty keylist then delete the storage key
This commit is contained in:
committed by
evilaliv3
parent
068d38d832
commit
37ce176d42
@@ -97,8 +97,12 @@ LocalStore.prototype.storePrivate = function (keys) {
|
||||
|
||||
function storeKeys(storage, itemname, keys) {
|
||||
var armoredKeys = [];
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
armoredKeys.push(keys[i].armor());
|
||||
if (keys.length) {
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
armoredKeys.push(keys[i].armor());
|
||||
}
|
||||
storage.setItem(itemname, JSON.stringify(armoredKeys));
|
||||
} else {
|
||||
storage.removeItem(itemname);
|
||||
}
|
||||
storage.setItem(itemname, JSON.stringify(armoredKeys));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user