diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2022-04-18 06:51:50 -0500 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2022-04-18 06:51:50 -0500 |
commit | 18801ed0c02627e87639dc0848cab44dacc18be2 (patch) | |
tree | 15e56ba66c68bf7b4594e6c9fdef44e037b4be31 /recipes/messenger/webview.js | |
parent | Remove deprecated webPreference flag (diff) | |
download | ferdium-recipes-18801ed0c02627e87639dc0848cab44dacc18be2.tar.gz ferdium-recipes-18801ed0c02627e87639dc0848cab44dacc18be2.tar.zst ferdium-recipes-18801ed0c02627e87639dc0848cab44dacc18be2.zip |
Rebranded from 'ferdi' to 'ferdium' (companion changes for the main repo PR #2)
Diffstat (limited to 'recipes/messenger/webview.js')
-rw-r--r-- | recipes/messenger/webview.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/recipes/messenger/webview.js b/recipes/messenger/webview.js index 45b4460..c90f4ad 100644 --- a/recipes/messenger/webview.js +++ b/recipes/messenger/webview.js | |||
@@ -1,4 +1,4 @@ | |||
1 | module.exports = Ferdi => { | 1 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 2 | const getMessages = () => { |
3 | let count = 0; | 3 | let count = 0; |
4 | 4 | ||
@@ -9,7 +9,7 @@ module.exports = Ferdi => { | |||
9 | * see https://github.com/ferdium/ferdium-app/issues/1113#issuecomment-783409154 | 9 | * see https://github.com/ferdium/ferdium-app/issues/1113#issuecomment-783409154 |
10 | */ | 10 | */ |
11 | if (isNotification) { | 11 | if (isNotification) { |
12 | count = Ferdi.safeParseInt(/^\((\d+)\)/.exec(document.title)[1]); | 12 | count = Ferdium.safeParseInt(/^\((\d+)\)/.exec(document.title)[1]); |
13 | } else { | 13 | } else { |
14 | /* | 14 | /* |
15 | * Notification case for direct messages, workaround by manavortex | 15 | * Notification case for direct messages, workaround by manavortex |
@@ -33,13 +33,13 @@ module.exports = Ferdi => { | |||
33 | */ | 33 | */ |
34 | const messageRequestsElement = document.querySelector('._5nxf'); | 34 | const messageRequestsElement = document.querySelector('._5nxf'); |
35 | if (messageRequestsElement) { | 35 | if (messageRequestsElement) { |
36 | count += Ferdi.safeParseInt(messageRequestsElement.textContent); | 36 | count += Ferdium.safeParseInt(messageRequestsElement.textContent); |
37 | } | 37 | } |
38 | 38 | ||
39 | Ferdi.setBadge(count); | 39 | Ferdium.setBadge(count); |
40 | }; | 40 | }; |
41 | 41 | ||
42 | Ferdi.loop(getMessages); | 42 | Ferdium.loop(getMessages); |
43 | 43 | ||
44 | localStorage.setItem( | 44 | localStorage.setItem( |
45 | '_cs_desktopNotifsEnabled', | 45 | '_cs_desktopNotifsEnabled', |
@@ -49,8 +49,8 @@ module.exports = Ferdi => { | |||
49 | }), | 49 | }), |
50 | ); | 50 | ); |
51 | 51 | ||
52 | if (typeof Ferdi.onNotify === 'function') { | 52 | if (typeof Ferdium.onNotify === 'function') { |
53 | Ferdi.onNotify(notification => { | 53 | Ferdium.onNotify(notification => { |
54 | if (typeof notification.title !== 'string') { | 54 | if (typeof notification.title !== 'string') { |
55 | notification.title = | 55 | notification.title = |
56 | ((notification.title.props || {}).content || [])[0] || 'Messenger'; | 56 | ((notification.title.props || {}).content || [])[0] || 'Messenger'; |