Added: plugin reload state in localstorage

This commit is contained in:
PiEgg
2018-12-17 23:56:11 +08:00
parent cdf7e14548
commit 72f2669cce
3 changed files with 39 additions and 4 deletions

15
src/renderer/utils/LS.js Normal file
View File

@@ -0,0 +1,15 @@
class LS {
get (name) {
if (localStorage.getItem(name)) {
return JSON.parse(localStorage.getItem(name))
} else {
return {}
}
}
set (name, value) {
return localStorage.setItem(name, JSON.stringify(value))
}
}
export default new LS()