diff options
author | 2021-09-12 22:01:51 +0530 | |
---|---|---|
committer | 2021-09-12 22:06:03 +0530 | |
commit | 9db43e100a672b6d6932ac68c0fbe503c129138b (patch) | |
tree | 4f6a31d25a7345c5d92dbd8b80d30ce7d129944f /recipes/aws-workmail/webview.js | |
parent | New recipe: 'stackoverflow' (#707) (diff) | |
download | ferdium-recipes-9db43e100a672b6d6932ac68c0fbe503c129138b.tar.gz ferdium-recipes-9db43e100a672b6d6932ac68c0fbe503c129138b.tar.zst ferdium-recipes-9db43e100a672b6d6932ac68c0fbe503c129138b.zip |
Added a check to verify that the folder name of the recipe matches the recipe id (#708)
Use the recipe-id as master to rename internal folder names
Diffstat (limited to 'recipes/aws-workmail/webview.js')
-rw-r--r-- | recipes/aws-workmail/webview.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/recipes/aws-workmail/webview.js b/recipes/aws-workmail/webview.js deleted file mode 100644 index 944a15c..0000000 --- a/recipes/aws-workmail/webview.js +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | module.exports = (Ferdi) => { | ||
2 | const reload = (EventType) => new Promise((resolve, reject) => { | ||
3 | const btn = document.getElementsByClassName('giraffe-hierarchy-node-refresh')[0]; | ||
4 | const EventObject = document.createEvent('Events'); | ||
5 | EventObject.initEvent(EventType, true, false); | ||
6 | |||
7 | if (btn.dispatchEvent(EventObject)) { | ||
8 | resolve(); | ||
9 | } else { | ||
10 | reject(); | ||
11 | } | ||
12 | }); | ||
13 | |||
14 | const getUnread = () => { | ||
15 | const nodes = document.getElementsByClassName('giraffe-hierarchy-node-counter'); | ||
16 | let counter = 0; | ||
17 | |||
18 | for (let i = 0; i < nodes.length; i++) { | ||
19 | counter += Ferdi.safeParseInt(nodes[i].innerText); | ||
20 | } | ||
21 | |||
22 | Ferdi.setBadge(counter); | ||
23 | }; | ||
24 | |||
25 | if (!window.location.pathname.includes('auth')) { | ||
26 | Ferdi.loop(getUnread); | ||
27 | |||
28 | window.setInterval(() => { | ||
29 | reload('click'); | ||
30 | }, 60000); | ||
31 | } | ||
32 | }; | ||