diff options
Diffstat (limited to 'src/webview/lib')
-rw-r--r-- | src/webview/lib/Userscript.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/webview/lib/Userscript.ts b/src/webview/lib/Userscript.ts index b0e4fb805..5adc1ac3a 100644 --- a/src/webview/lib/Userscript.ts +++ b/src/webview/lib/Userscript.ts | |||
@@ -32,7 +32,7 @@ export default class Userscript { | |||
32 | * | 32 | * |
33 | * @param {*} settings | 33 | * @param {*} settings |
34 | */ | 34 | */ |
35 | // eslint-disable-next-line camelcase | 35 | |
36 | internal_setSettings(settings: any) { | 36 | internal_setSettings(settings: any) { |
37 | // 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 |
38 | // Otherwise this will be a mobX instance | 38 | // Otherwise this will be a mobX instance |
@@ -45,7 +45,7 @@ export default class Userscript { | |||
45 | * @param {number} indirect Indirect messages | 45 | * @param {number} indirect Indirect messages |
46 | */ | 46 | */ |
47 | setBadge(direct: number = 0, indirect: number = 0) { | 47 | setBadge(direct: number = 0, indirect: number = 0) { |
48 | if (this.recipe && this.recipe.setBadge) { | 48 | if (this.recipe?.setBadge) { |
49 | this.recipe.setBadge(direct, indirect); | 49 | this.recipe.setBadge(direct, indirect); |
50 | } | 50 | } |
51 | } | 51 | } |
@@ -55,7 +55,7 @@ export default class Userscript { | |||
55 | * @param {*} title Dialog title | 55 | * @param {*} title Dialog title |
56 | */ | 56 | */ |
57 | setDialogTitle(title: string) { | 57 | setDialogTitle(title: string) { |
58 | if (this.recipe && this.recipe.setDialogTitle) { | 58 | if (this.recipe?.setDialogTitle) { |
59 | this.recipe.setDialogTitle(title); | 59 | this.recipe.setDialogTitle(title); |
60 | } | 60 | } |
61 | } | 61 | } |
@@ -66,7 +66,7 @@ export default class Userscript { | |||
66 | * @param {...string} files | 66 | * @param {...string} files |
67 | */ | 67 | */ |
68 | injectCSSFiles(...files: string[]) { | 68 | injectCSSFiles(...files: string[]) { |
69 | if (this.recipe && this.recipe.injectCSS) { | 69 | if (this.recipe?.injectCSS) { |
70 | // @ts-expect-error A spread argument must either have a tuple type or be passed to a rest parameter. | 70 | // @ts-expect-error A spread argument must either have a tuple type or be passed to a rest parameter. |
71 | this.recipe.injectCSS(...files); | 71 | this.recipe.injectCSS(...files); |
72 | } | 72 | } |
@@ -99,6 +99,7 @@ export default class Userscript { | |||
99 | * @param {string} key | 99 | * @param {string} key |
100 | * @return Value of the key | 100 | * @return Value of the key |
101 | */ | 101 | */ |
102 | // eslint-disable-next-line consistent-return | ||
102 | get(key: string) { | 103 | get(key: string) { |
103 | const ferdiumUserKey = window.localStorage.getItem(`ferdium-user-${key}`); | 104 | const ferdiumUserKey = window.localStorage.getItem(`ferdium-user-${key}`); |
104 | 105 | ||