diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2023-07-26 06:29:03 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 17:59:03 +0530 |
commit | 9b8f01716774a960073e944823ab727cc867a8f6 (patch) | |
tree | 732b83770baa78f5cf12776aaa33ce65bebfa418 /recipes/infomaniak-mail/webview.js | |
parent | Add Excalidraw recipe (#393) (diff) | |
download | ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.tar.gz ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.tar.zst ferdium-recipes-9b8f01716774a960073e944823ab727cc867a8f6.zip |
chore: improve lint setup (#397)
- update eslint config to closely mirror the ones from ferdium-app
- add .eslintignore
- opt in to eslint `reportUnusedDisableDirectives` config option
- remove `trailingComma: all` from `prettier` config which is default in `prettier` v3
- autofix or disable a lot of lint issues throughout codebase
- add `volta` configuration to `package.json` to autoload correct `node` and `pnpm` versions
- upgrade all `eslint` and `prettier` related dependencies to latest
- update lint:fix npm script
- reformat touched files with prettier
- bumped up minor version for all recipes that have changes
- introduced injection of 'service.css' where it was missing in many recipes
---------
Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Diffstat (limited to 'recipes/infomaniak-mail/webview.js')
-rw-r--r-- | recipes/infomaniak-mail/webview.js | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/recipes/infomaniak-mail/webview.js b/recipes/infomaniak-mail/webview.js index 23516b2..5af4d25 100644 --- a/recipes/infomaniak-mail/webview.js +++ b/recipes/infomaniak-mail/webview.js | |||
@@ -1,10 +1,18 @@ | |||
1 | function _interopRequireDefault(obj) { | ||
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
4 | |||
5 | const _path = _interopRequireDefault(require('path')); | ||
6 | |||
1 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
2 | const getMessages = () => { | 8 | const getMessages = () => { |
3 | // This selects the first folder (the inbox and reads its unread messages count) | 9 | // This selects the first folder (the inbox and reads its unread messages count) |
4 | const inboxField = document.querySelector('.ws-tree-node-content') | 10 | const inboxField = document.querySelector('.ws-tree-node-content'); |
5 | const inboxCountField = inboxField.querySelector('.ws-tree-node-badge'); | 11 | const inboxCountField = inboxField.querySelector('.ws-tree-node-badge'); |
6 | const inboxCountText = inboxCountField ? inboxCountField.textContent : null; | 12 | const inboxCountText = inboxCountField ? inboxCountField.textContent : null; |
7 | const inboxCount = inboxCountText ? Ferdium.safeParseInt(inboxCountText) : 0; | 13 | const inboxCount = inboxCountText |
14 | ? Ferdium.safeParseInt(inboxCountText) | ||
15 | : 0; | ||
8 | 16 | ||
9 | let unimportantCount = 0; | 17 | let unimportantCount = 0; |
10 | 18 | ||
@@ -12,12 +20,18 @@ module.exports = Ferdium => { | |||
12 | // This selects the first folder with an unread message count. | 20 | // This selects the first folder with an unread message count. |
13 | // The actaul count and the total of all other folders is not needed as the badge has no number. | 21 | // The actaul count and the total of all other folders is not needed as the badge has no number. |
14 | const totalCountField = document.querySelector('.ws-tree-node-badge'); | 22 | const totalCountField = document.querySelector('.ws-tree-node-badge'); |
15 | const totalCountText = totalCountField ? totalCountField.textContent : null; | 23 | const totalCountText = totalCountField |
16 | unimportantCount = totalCountText ? Ferdium.safeParseInt(totalCountText) : 0; | 24 | ? totalCountField.textContent |
25 | : null; | ||
26 | unimportantCount = totalCountText | ||
27 | ? Ferdium.safeParseInt(totalCountText) | ||
28 | : 0; | ||
17 | } | 29 | } |
18 | 30 | ||
19 | Ferdium.setBadge(inboxCount, unimportantCount); | 31 | Ferdium.setBadge(inboxCount, unimportantCount); |
20 | }; | 32 | }; |
21 | 33 | ||
22 | Ferdium.loop(getMessages); | 34 | Ferdium.loop(getMessages); |
35 | |||
36 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
23 | }; | 37 | }; |