diff options
Diffstat (limited to 'src/webview')
-rw-r--r-- | src/webview/lib/Userscript.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/webview/lib/Userscript.ts b/src/webview/lib/Userscript.ts index f02a8f135..b0e4fb805 100644 --- a/src/webview/lib/Userscript.ts +++ b/src/webview/lib/Userscript.ts | |||
@@ -1,3 +1,5 @@ | |||
1 | import { cleanseJSObject, convertToJSON } from '../../jsUtils'; | ||
2 | |||
1 | type Recipe = { | 3 | type Recipe = { |
2 | setBadge: (direct: number, indirect: number) => void; | 4 | setBadge: (direct: number, indirect: number) => void; |
3 | setDialogTitle: (title: string) => void; | 5 | setDialogTitle: (title: string) => void; |
@@ -34,7 +36,7 @@ export default class Userscript { | |||
34 | internal_setSettings(settings: any) { | 36 | internal_setSettings(settings: any) { |
35 | // This is needed to get a clean JS object from the settings itself to provide better accessibility | 37 | // This is needed to get a clean JS object from the settings itself to provide better accessibility |
36 | // Otherwise this will be a mobX instance | 38 | // Otherwise this will be a mobX instance |
37 | this.settings = JSON.parse(JSON.stringify(settings)); | 39 | this.settings = cleanseJSObject(settings); |
38 | } | 40 | } |
39 | 41 | ||
40 | /** | 42 | /** |
@@ -101,7 +103,7 @@ export default class Userscript { | |||
101 | const ferdiumUserKey = window.localStorage.getItem(`ferdium-user-${key}`); | 103 | const ferdiumUserKey = window.localStorage.getItem(`ferdium-user-${key}`); |
102 | 104 | ||
103 | if (ferdiumUserKey) { | 105 | if (ferdiumUserKey) { |
104 | return JSON.parse(ferdiumUserKey); | 106 | return convertToJSON(ferdiumUserKey); |
105 | } | 107 | } |
106 | } | 108 | } |
107 | } | 109 | } |