diff options
author | 2021-06-29 13:27:15 +0530 | |
---|---|---|
committer | 2021-06-29 13:28:24 +0530 | |
commit | 5e56414aa64b339dfdd817a8e49e08c5179d3bdd (patch) | |
tree | d2d966b8cafc80aa1d45920ae9de8e41ea85f05a /recipes/superhuman-email/webview.js | |
parent | Added new GH Actions workflow to welcome first time contributors. [skip ci] (diff) | |
download | ferdium-recipes-5e56414aa64b339dfdd817a8e49e08c5179d3bdd.tar.gz ferdium-recipes-5e56414aa64b339dfdd817a8e49e08c5179d3bdd.tar.zst ferdium-recipes-5e56414aa64b339dfdd817a8e49e08c5179d3bdd.zip |
Adding new recipe: Superhuman (Fixes #573)
Diffstat (limited to 'recipes/superhuman-email/webview.js')
-rw-r--r-- | recipes/superhuman-email/webview.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/recipes/superhuman-email/webview.js b/recipes/superhuman-email/webview.js new file mode 100644 index 0000000..2719e25 --- /dev/null +++ b/recipes/superhuman-email/webview.js | |||
@@ -0,0 +1,13 @@ | |||
1 | 'use strict'; | ||
2 | |||
3 | module.exports = (Franz, options) => { | ||
4 | const getMessages = () => { | ||
5 | // Get the number of mentions | ||
6 | const mentions = document.querySelectorAll('.chat-line .mentioned').length; | ||
7 | |||
8 | Franz.setBadge(mentions, 0); | ||
9 | }; | ||
10 | // check for new messages every second and update Franz badge | ||
11 | Franz.loop(getMessages); | ||
12 | }; | ||
13 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInR3aXRjaC93ZWJ2aWV3LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJGcmFueiIsIm9wdGlvbnMiLCJnZXRNZXNzYWdlcyIsIm1lbnRpb25zIiwiZG9jdW1lbnQiLCJxdWVyeVNlbGVjdG9yQWxsIiwibGVuZ3RoIiwic2V0QmFkZ2UiLCJsb29wIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxPQUFPQyxPQUFQLEdBQ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