aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/chatwoot
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/chatwoot')
-rw-r--r--recipes/chatwoot/index.js2
-rw-r--r--recipes/chatwoot/package.json3
-rw-r--r--recipes/chatwoot/webview.js8
3 files changed, 6 insertions, 7 deletions
diff --git a/recipes/chatwoot/index.js b/recipes/chatwoot/index.js
index 653b54c..244fe33 100644
--- a/recipes/chatwoot/index.js
+++ b/recipes/chatwoot/index.js
@@ -1 +1 @@
module.exports = (Ferdi) => Ferdi; module.exports = (Ferdium) => Ferdium;
diff --git a/recipes/chatwoot/package.json b/recipes/chatwoot/package.json
index 6c024e7..c3c1a79 100644
--- a/recipes/chatwoot/package.json
+++ b/recipes/chatwoot/package.json
@@ -1,11 +1,10 @@
1{ 1{
2 "id": "chatwoot", 2 "id": "chatwoot",
3 "name": "Chatwoot", 3 "name": "Chatwoot",
4 "version": "1.0.0", 4 "version": "1.1.0",
5 "license": "MIT", 5 "license": "MIT",
6 "repository": "https://github.com/maximeMD/ferdi-chatwoot", 6 "repository": "https://github.com/maximeMD/ferdi-chatwoot",
7 "config": { 7 "config": {
8 "serviceURL": "https://app.chatwoot.com/app/login" 8 "serviceURL": "https://app.chatwoot.com/app/login"
9 } 9 }
10 } 10 }
11 \ No newline at end of file
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 @@
1module.exports = (Ferdi) => { 1module.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};