open-vault/ui/app/lib/local-storage.js
Chelsea Shaw c67f4927b2
Revert UI: replace localStorage with sessionStorage (#15769)
* Revert UI: replace localStorage with sessionStorage

* Add changelog
2022-06-02 15:19:57 -05:00

19 lines
351 B
JavaScript

export default {
getItem(key) {
var item = window.localStorage.getItem(key);
return item && JSON.parse(item);
},
setItem(key, val) {
window.localStorage.setItem(key, JSON.stringify(val));
},
removeItem(key) {
return window.localStorage.removeItem(key);
},
keys() {
return Object.keys(window.localStorage);
},
};