diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-09-14 19:58:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 19:58:52 +0200 |
commit | 95df3522a15631abc51a4295cae0ea401a8d4e1e (patch) | |
tree | e5eb0f368c947683f01458e912f21756fb0d99cb /src/webview/lib/Userscript.js | |
parent | docs: add sad270 as a contributor for bug, userTesting [skip ci] (#1941) (diff) | |
download | ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.gz ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.zst ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.zip |
feat: add eslint-plugin-unicorn (#1936)
Diffstat (limited to 'src/webview/lib/Userscript.js')
-rw-r--r-- | src/webview/lib/Userscript.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/webview/lib/Userscript.js b/src/webview/lib/Userscript.js index 2043d9fff..bed2b1ff8 100644 --- a/src/webview/lib/Userscript.js +++ b/src/webview/lib/Userscript.js | |||
@@ -28,7 +28,7 @@ export default class Userscript { | |||
28 | * | 28 | * |
29 | * @param {*} settings | 29 | * @param {*} settings |
30 | */ | 30 | */ |
31 | // eslint-disable-next-line | 31 | // eslint-disable-next-line camelcase |
32 | internal_setSettings(settings) { | 32 | internal_setSettings(settings) { |
33 | // This is needed to get a clean JS object from the settings itself to provide better accessibility | 33 | // This is needed to get a clean JS object from the settings itself to provide better accessibility |
34 | // Otherwise this will be a mobX instance | 34 | // Otherwise this will be a mobX instance |
@@ -95,9 +95,7 @@ export default class Userscript { | |||
95 | * @param {*} value | 95 | * @param {*} value |
96 | */ | 96 | */ |
97 | set(key, value) { | 97 | set(key, value) { |
98 | window.localStorage.setItem( | 98 | window.localStorage.setItem(`ferdi-user-${key}`, JSON.stringify(value)); |
99 | `ferdi-user-${key}`, JSON.stringify(value), | ||
100 | ); | ||
101 | } | 99 | } |
102 | 100 | ||
103 | /** | 101 | /** |
@@ -107,9 +105,7 @@ export default class Userscript { | |||
107 | * @return Value of the key | 105 | * @return Value of the key |
108 | */ | 106 | */ |
109 | get(key) { | 107 | get(key) { |
110 | return JSON.parse(window.localStorage.getItem( | 108 | return JSON.parse(window.localStorage.getItem(`ferdi-user-${key}`)); |
111 | `ferdi-user-${key}`, | ||
112 | )); | ||
113 | } | 109 | } |
114 | 110 | ||
115 | /** | 111 | /** |