diff options
author | 2022-04-18 06:51:50 -0500 | |
---|---|---|
committer | 2022-04-18 06:51:50 -0500 | |
commit | 18801ed0c02627e87639dc0848cab44dacc18be2 (patch) | |
tree | 15e56ba66c68bf7b4594e6c9fdef44e037b4be31 /recipes/chatwoot/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/chatwoot/webview.js')
-rw-r--r-- | recipes/chatwoot/webview.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/recipes/chatwoot/webview.js b/recipes/chatwoot/webview.js index 05e33b3..d61b87f 100644 --- a/recipes/chatwoot/webview.js +++ b/recipes/chatwoot/webview.js | |||
@@ -1,14 +1,14 @@ | |||
1 | module.exports = (Ferdi) => { | 1 | module.exports = (Ferdium) => { |
2 | const getMessages = function getMessages() { | 2 | const getMessages = function getMessages() { |
3 | const unreadBadges = document.querySelectorAll("span.unread"); | 3 | const unreadBadges = document.querySelectorAll("span.unread"); |
4 | const unreadBadgesArray = [...unreadBadges]; | 4 | const unreadBadgesArray = [...unreadBadges]; |
5 | const unreadMessagesCount = unreadBadgesArray.reduce( | 5 | const unreadMessagesCount = unreadBadgesArray.reduce( |
6 | (previousValue, currentBadge) => | 6 | (previousValue, currentBadge) => |
7 | previousValue + Ferdi.safeParseInt(currentBadge.textContent), | 7 | previousValue + Ferdium.safeParseInt(currentBadge.textContent), |
8 | 0, | 8 | 0, |
9 | ); | 9 | ); |
10 | Ferdi.setBadge(unreadMessagesCount); | 10 | Ferdium.setBadge(unreadMessagesCount); |
11 | }; | 11 | }; |
12 | 12 | ||
13 | Ferdi.loop(getMessages); | 13 | Ferdium.loop(getMessages); |
14 | }; | 14 | }; |