aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2023-05-24 06:57:50 +0530
committerLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2023-05-24 16:40:43 +0530
commite245b4fa229bee1e2ab97fcb42de3831b8bdbe5b (patch)
treed684777b3fde5470c9f99304a9f022422ffb8045 /src/webview
parent6.3.0-nightly.9 [skip ci] (diff)
downloadferdium-app-e245b4fa229bee1e2ab97fcb42de3831b8bdbe5b.tar.gz
ferdium-app-e245b4fa229bee1e2ab97fcb42de3831b8bdbe5b.tar.zst
ferdium-app-e245b4fa229bee1e2ab97fcb42de3831b8bdbe5b.zip
Upgrade npm modules
Diffstat (limited to 'src/webview')
-rw-r--r--src/webview/darkmode.ts4
-rw-r--r--src/webview/lib/RecipeWebview.ts4
-rw-r--r--src/webview/recipe.ts6
3 files changed, 7 insertions, 7 deletions
diff --git a/src/webview/darkmode.ts b/src/webview/darkmode.ts
index 9944a7afa..f5e8700e0 100644
--- a/src/webview/darkmode.ts
+++ b/src/webview/darkmode.ts
@@ -5,7 +5,7 @@ const debug = require('../preload-safe-debug')('Ferdium:DarkMode');
5 5
6const chars = [...'abcdefghijklmnopqrstuvwxyz']; 6const chars = [...'abcdefghijklmnopqrstuvwxyz'];
7 7
8const ID = [...Array.from({ length: 20 })] 8const ID = Array.from({ length: 20 })
9 .map(() => chars[Math.trunc(Math.random() * chars.length)]) 9 .map(() => chars[Math.trunc(Math.random() * chars.length)])
10 .join(''); 10 .join('');
11 11
@@ -26,7 +26,7 @@ export function injectDarkModeStyle(recipePath: string) {
26 styles.innerHTML = data.toString(); 26 styles.innerHTML = data.toString();
27 debug('Loaded darkmode.css from: ', darkmodeCss); 27 debug('Loaded darkmode.css from: ', darkmodeCss);
28 28
29 document.querySelector('head')?.appendChild(styles); 29 document.querySelector('head')?.append(styles);
30 30
31 debug('Injected Dark Mode style with ID', ID); 31 debug('Injected Dark Mode style with ID', ID);
32 } 32 }
diff --git a/src/webview/lib/RecipeWebview.ts b/src/webview/lib/RecipeWebview.ts
index 436525b9e..44b3c5ab4 100644
--- a/src/webview/lib/RecipeWebview.ts
+++ b/src/webview/lib/RecipeWebview.ts
@@ -101,13 +101,13 @@ class RecipeWebview {
101 * @param {string | number | undefined | null} text to be parsed 101 * @param {string | number | undefined | null} text to be parsed
102 */ 102 */
103 isImage(link): boolean { 103 isImage(link): boolean {
104 if (typeof link === 'undefined') { 104 if (link === undefined) {
105 return false; 105 return false;
106 } 106 }
107 107
108 const { role } = link.dataset; 108 const { role } = link.dataset;
109 109
110 if (typeof role !== 'undefined') { 110 if (role !== undefined) {
111 const roles = ['img']; 111 const roles = ['img'];
112 return roles.includes(role); 112 return roles.includes(role);
113 } 113 }
diff --git a/src/webview/recipe.ts b/src/webview/recipe.ts
index 36b8b7c98..0d18e4347 100644
--- a/src/webview/recipe.ts
+++ b/src/webview/recipe.ts
@@ -280,12 +280,12 @@ class RecipeController {
280 } 280 }
281 }; 281 };
282 282
283 if (document.readyState !== 'loading') { 283 if (document.readyState === 'loading') {
284 loadUserJs();
285 } else {
286 document.addEventListener('DOMContentLoaded', () => { 284 document.addEventListener('DOMContentLoaded', () => {
287 loadUserJs(); 285 loadUserJs();
288 }); 286 });
287 } else {
288 loadUserJs();
289 } 289 }
290 } 290 }
291 } 291 }