diff options
author | 2021-08-27 18:13:24 +0530 | |
---|---|---|
committer | 2021-08-27 18:13:24 +0530 | |
commit | 155c4b832281348c16be1f4ef667e6e23dbf1bd8 (patch) | |
tree | d144e2de2e6c7fb2e334246e8a4aecdbeb08ef8d /recipes/whatsapp/webview.js | |
parent | docs: fixed template file for creating recipe. (diff) | |
download | ferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.tar.gz ferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.tar.zst ferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.zip |
chore: normalized all recipes to ensure compatibility with es6 (#639)
- Removed some calls to set badge with '0' all the time.
- Removed all 'sourceMaps' since they are all outdated atm.
Diffstat (limited to 'recipes/whatsapp/webview.js')
-rw-r--r-- | recipes/whatsapp/webview.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/recipes/whatsapp/webview.js b/recipes/whatsapp/webview.js index 143c066..773caa8 100644 --- a/recipes/whatsapp/webview.js +++ b/recipes/whatsapp/webview.js | |||
@@ -1,13 +1,12 @@ | |||
1 | const { | 1 | const { remote } = require('electron'); |
2 | remote, | ||
3 | } = require('electron'); | ||
4 | 2 | ||
5 | const path = require('path'); | 3 | const _path = _interopRequireDefault(require('path')); |
4 | |||
5 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
6 | 6 | ||
7 | const webContents = remote.getCurrentWebContents(); | 7 | const webContents = remote.getCurrentWebContents(); |
8 | const { | 8 | const { session } = webContents; |
9 | session, | 9 | |
10 | } = webContents; | ||
11 | window.addEventListener('beforeunload', async () => { | 10 | window.addEventListener('beforeunload', async () => { |
12 | try { | 11 | try { |
13 | session.flushStorageData(); | 12 | session.flushStorageData(); |
@@ -24,7 +23,7 @@ window.addEventListener('beforeunload', async () => { | |||
24 | } | 23 | } |
25 | }); | 24 | }); |
26 | 25 | ||
27 | module.exports = Franz => { | 26 | module.exports = Ferdi => { |
28 | const getMessages = function getMessages() { | 27 | const getMessages = function getMessages() { |
29 | let count = 0; | 28 | let count = 0; |
30 | let indirectCount = 0; | 29 | let indirectCount = 0; |
@@ -46,9 +45,10 @@ module.exports = Franz => { | |||
46 | } | 45 | } |
47 | } | 46 | } |
48 | 47 | ||
49 | Franz.setBadge(count, indirectCount); | 48 | Ferdi.setBadge(count, indirectCount); |
50 | }; | 49 | }; |
51 | 50 | ||
52 | Franz.injectCSS(path.join(__dirname, 'service.css')); | 51 | Ferdi.loop(getMessages); |
53 | Franz.loop(getMessages); | 52 | |
53 | Ferdi.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
54 | }; | 54 | }; |