diff options
author | 2021-07-31 15:28:23 +0530 | |
---|---|---|
committer | 2021-07-31 15:28:23 +0530 | |
commit | 97697e3d069972844b2912a93022f4a4904a40d6 (patch) | |
tree | 53faff30fbac9d72042f593dfe1c547809f4f121 /recipes/discord/webview.js | |
parent | Allow any url in the custom-service to allow for sites like 'http://translate... (diff) | |
download | ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.tar.gz ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.tar.zst ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.zip |
Fixed eslintrc as root for this folder; Reformatted all files.
Diffstat (limited to 'recipes/discord/webview.js')
-rw-r--r-- | recipes/discord/webview.js | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/recipes/discord/webview.js b/recipes/discord/webview.js index 2d68a44..270ca0e 100644 --- a/recipes/discord/webview.js +++ b/recipes/discord/webview.js | |||
@@ -1,28 +1,25 @@ | |||
1 | "use strict"; | 1 | const _path = _interopRequireDefault(require('path')); |
2 | |||
3 | var _path = _interopRequireDefault(require("path")); | ||
4 | 2 | ||
5 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
6 | 4 | ||
7 | module.exports = Franz => { | 5 | module.exports = Franz => { |
8 | const getMessages = function getMessages() { | 6 | const getMessages = function getMessages() { |
9 | const direct = document.querySelector('[class*="guilds-"]').querySelectorAll('[class^="numberBadge-"]').length; | 7 | const direct = document.querySelector('[class*="guilds-"]').querySelectorAll('[class^="numberBadge-"]').length; |
10 | 8 | ||
11 | var indirect = 0; | 9 | let indirect = 0; |
12 | var guilds = document.querySelector("[data-ref-id=guildsnav]"); | 10 | const guilds = document.querySelector('[data-ref-id=guildsnav]'); |
13 | if(guilds != null) { | 11 | if (guilds != null) { |
14 | var channelPills = [].slice.call(guilds.querySelectorAll("[class*=item-2hkk8m]")); | 12 | const channelPills = [].slice.call(guilds.querySelectorAll('[class*=item-2hkk8m]')); |
15 | indirect += channelPills.filter(y => y.clientHeight == 8).length; | 13 | indirect += channelPills.filter(y => y.clientHeight == 8).length; |
16 | 14 | ||
17 | var activeWindow = channelPills.find(y => y.clientHeight == 40); | 15 | const activeWindow = channelPills.find(y => y.clientHeight == 40); |
18 | if(activeWindow != null) { | 16 | if (activeWindow != null) { |
19 | var unreadChannels = document.querySelector("[class*=modeUnread]"); | 17 | const unreadChannels = document.querySelector('[class*=modeUnread]'); |
20 | 18 | ||
21 | if(unreadChannels != null) | 19 | if (unreadChannels != null) indirect++; |
22 | indirect++; | 20 | } |
23 | } | 21 | } |
24 | } | 22 | |
25 | |||
26 | Franz.setBadge(direct, indirect); | 23 | Franz.setBadge(direct, indirect); |
27 | }; | 24 | }; |
28 | 25 | ||