diff options
author | Amine <amine@mouafik.fr> | 2020-04-22 07:13:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-22 07:13:51 +0000 |
commit | 911d1ded846165a4b420efa2b58668ad27c9f2c7 (patch) | |
tree | 01d75a16ac89da73b6e28ce730a44ba0a0809f29 /uncompressed/github/webview.js | |
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/webview.js')
-rw-r--r-- | uncompressed/github/webview.js | 14 |
1 files changed, 12 insertions, 2 deletions
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 |