aboutsummaryrefslogtreecommitdiffstats
path: root/recipes
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-09-23 20:18:53 +0530
committerLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2021-09-23 20:19:48 +0530
commit1a4890a7a52ac34ca54c84b4e8b014ec7928632d (patch)
treec2c73bc91f2d95351eef777cc389e7907a16e16c /recipes
parentfeature: allow services to delineate favorites vs non-favorites in unread counts (diff)
downloadferdium-recipes-1a4890a7a52ac34ca54c84b4e8b014ec7928632d.tar.gz
ferdium-recipes-1a4890a7a52ac34ca54c84b4e8b014ec7928632d.tar.zst
ferdium-recipes-1a4890a7a52ac34ca54c84b4e8b014ec7928632d.zip
fix: implement unread count badge for 'stackoverflow-chat'
Diffstat (limited to 'recipes')
-rw-r--r--recipes/stackoverflow-chat/package.json2
-rw-r--r--recipes/stackoverflow-chat/webview.js15
2 files changed, 10 insertions, 7 deletions
diff --git a/recipes/stackoverflow-chat/package.json b/recipes/stackoverflow-chat/package.json
index 688db65..4cbddeb 100644
--- a/recipes/stackoverflow-chat/package.json
+++ b/recipes/stackoverflow-chat/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "stackoverflow-chat", 2 "id": "stackoverflow-chat",
3 "name": "Stackoverflow chat", 3 "name": "Stackoverflow chat",
4 "version": "1.0.0", 4 "version": "1.0.1",
5 "license": "MIT", 5 "license": "MIT",
6 "config": { 6 "config": {
7 "serviceURL": "https://chat.stackoverflow.com/", 7 "serviceURL": "https://chat.stackoverflow.com/",
diff --git a/recipes/stackoverflow-chat/webview.js b/recipes/stackoverflow-chat/webview.js
index 044c773..cf487b5 100644
--- a/recipes/stackoverflow-chat/webview.js
+++ b/recipes/stackoverflow-chat/webview.js
@@ -3,12 +3,15 @@ var _path = _interopRequireDefault(require('path'));
3function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 3function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4 4
5module.exports = Ferdi => { 5module.exports = Ferdi => {
6 // TODO: If your stackoverflow-chat service has unread messages, uncomment these lines to implement the logic for updating the badges 6 const getMessages = () => {
7 // const getMessages = () => { 7 const unreadSpan = document.querySelector('span.flag-count.message-count.unread-count');
8 // // TODO: Insert your notification-finding code here 8 let directCount = 0;
9 // Ferdi.setBadge(0, 0); 9 if (unreadSpan) {
10 // }; 10 directCount = Ferdi.safeParseInt(unreadSpan.innerText);
11 // Ferdi.loop(getMessages); 11 }
12 Ferdi.setBadge(directCount);
13 };
14 Ferdi.loop(getMessages);
12 15
13 Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); 16 Ferdi.injectCSS(_path.default.join(__dirname, 'service.css'));
14}; 17};