diff options
author | 2020-04-22 07:13:51 +0000 | |
---|---|---|
committer | 2020-04-22 07:13:51 +0000 | |
commit | 911d1ded846165a4b420efa2b58668ad27c9f2c7 (patch) | |
tree | 01d75a16ac89da73b6e28ce730a44ba0a0809f29 /uncompressed/github | |
parent | Switch back to original Telegram, add Telegram React (#132) (diff) | |
download | ferdium-recipes-911d1ded846165a4b420efa2b58668ad27c9f2c7.tar.gz ferdium-recipes-911d1ded846165a4b420efa2b58668ad27c9f2c7.tar.zst ferdium-recipes-911d1ded846165a4b420efa2b58668ad27c9f2c7.zip |
Use GitHub notifications center and direct notifications (#133)
Diffstat (limited to 'uncompressed/github')
-rw-r--r-- | uncompressed/github/package.json | 8 | ||||
-rw-r--r-- | uncompressed/github/webview.js | 14 |
2 files changed, 16 insertions, 6 deletions
diff --git a/uncompressed/github/package.json b/uncompressed/github/package.json index 38ec914..535c1d9 100644 --- a/uncompressed/github/package.json +++ b/uncompressed/github/package.json | |||
@@ -1,15 +1,15 @@ | |||
1 | { | 1 | { |
2 | "id": "github", | 2 | "id": "github", |
3 | "name": "GitHub", | 3 | "name": "GitHub", |
4 | "version": "1.0.4", | 4 | "version": "2.0.0", |
5 | "description": "GitHub", | 5 | "description": "GitHub", |
6 | "main": "index.js", | 6 | "main": "index.js", |
7 | "author": "Sudhir Ganesan", | 7 | "author": "Amine Mouafik", |
8 | "license": "MIT", | 8 | "license": "MIT", |
9 | "config": { | 9 | "config": { |
10 | "serviceURL": "https://github.com/", | 10 | "serviceURL": "https://github.com/notifications", |
11 | "hasNotificationSound": false, | 11 | "hasNotificationSound": false, |
12 | "hasDirectMessages": false, | 12 | "hasDirectMessages": true, |
13 | "hasIndirectMessages": true | 13 | "hasIndirectMessages": true |
14 | } | 14 | } |
15 | } | 15 | } |
diff --git a/uncompressed/github/webview.js b/uncompressed/github/webview.js index 0543d1f..c3e8729 100644 --- a/uncompressed/github/webview.js +++ b/uncompressed/github/webview.js | |||
@@ -2,9 +2,19 @@ | |||
2 | 2 | ||
3 | module.exports = Franz => { | 3 | module.exports = Franz => { |
4 | const getMessages = function getMessages() { | 4 | const getMessages = function getMessages() { |
5 | Franz.setBadge(document.querySelector('[class*="mail-status unread"]') !== null ? 1 : 0); | 5 | const directCountElement = document.querySelector('.filter-list .count'); |
6 | const indirectCountElement = document.querySelector('[class*="mail-status unread"]') | ||
7 | let directCount, indirectCount | ||
8 | if (directCountElement) { | ||
9 | directCount = parseInt(directCountElement.innerHTML, 10); | ||
10 | } else { | ||
11 | if (indirectCountElement) { | ||
12 | indirectCount = 1; | ||
13 | } | ||
14 | } | ||
15 | Franz.setBadge(directCount, indirectCount); | ||
6 | }; | 16 | }; |
7 | 17 | ||
8 | Franz.loop(0, getMessages); | 18 | Franz.loop(getMessages); |
9 | } | 19 | } |
10 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJnaXRodWIvd2Vidmlldy5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0= \ No newline at end of file | 20 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJnaXRodWIvd2Vidmlldy5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0= \ No newline at end of file |