aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/whatsapp/webview.js
diff options
context:
space:
mode:
authorLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-08-27 18:13:24 +0530
committerLibravatar GitHub <noreply@github.com>2021-08-27 18:13:24 +0530
commit155c4b832281348c16be1f4ef667e6e23dbf1bd8 (patch)
treed144e2de2e6c7fb2e334246e8a4aecdbeb08ef8d /recipes/whatsapp/webview.js
parentdocs: fixed template file for creating recipe. (diff)
downloadferdium-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.js22
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 @@
1const { 1const { remote } = require('electron');
2 remote,
3} = require('electron');
4 2
5const path = require('path'); 3const _path = _interopRequireDefault(require('path'));
4
5function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6 6
7const webContents = remote.getCurrentWebContents(); 7const webContents = remote.getCurrentWebContents();
8const { 8const { session } = webContents;
9 session, 9
10} = webContents;
11window.addEventListener('beforeunload', async () => { 10window.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
27module.exports = Franz => { 26module.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};