aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/whatsapp
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-05-26 18:10:17 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-05-26 20:34:46 +0530
commite05d27ea49929e763906e6c430ec79c1a093dde7 (patch)
tree89cbe160de00b97d45537b0d2fc589244f8a24c7 /recipes/whatsapp
parentMinifying images (diff)
downloadferdium-recipes-e05d27ea49929e763906e6c430ec79c1a093dde7.tar.gz
ferdium-recipes-e05d27ea49929e763906e6c430ec79c1a093dde7.tar.zst
ferdium-recipes-e05d27ea49929e763906e6c430ec79c1a093dde7.zip
Replace 'remote' with 'electron/remote'
Bumped up major version for affected recipes to denote breaking changes
Diffstat (limited to 'recipes/whatsapp')
-rw-r--r--recipes/whatsapp/package.json2
-rw-r--r--recipes/whatsapp/webview.js12
2 files changed, 7 insertions, 7 deletions
diff --git a/recipes/whatsapp/package.json b/recipes/whatsapp/package.json
index 794623e..e9c4bf4 100644
--- a/recipes/whatsapp/package.json
+++ b/recipes/whatsapp/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "whatsapp", 2 "id": "whatsapp",
3 "name": "WhatsApp", 3 "name": "WhatsApp",
4 "version": "2.0.9", 4 "version": "3.0.0",
5 "description": "WhatsApp", 5 "description": "WhatsApp",
6 "main": "index.js", 6 "main": "index.js",
7 "author": "Stefan Malzner <stefan@adlk.io>", 7 "author": "Stefan Malzner <stefan@adlk.io>",
diff --git a/recipes/whatsapp/webview.js b/recipes/whatsapp/webview.js
index 169b54c..5dd3729 100644
--- a/recipes/whatsapp/webview.js
+++ b/recipes/whatsapp/webview.js
@@ -1,12 +1,12 @@
1"use strict"; 1"use strict";
2 2
3const { 3const {
4 remote 4 getCurrentWebContents
5} = require('electron'); 5} = require('@electron/remote');
6 6
7const path = require('path'); 7const path = require('path');
8 8
9const webContents = remote.getCurrentWebContents(); 9const webContents = getCurrentWebContents();
10const { 10const {
11 session 11 session
12} = webContents; 12} = webContents;
@@ -36,16 +36,16 @@ module.exports = Franz => {
36 for (var i = 0; i < chatElems.length; i++) { 36 for (var i = 0; i < chatElems.length; i++) {
37 var chatElem = chatElems[i]; 37 var chatElem = chatElems[i];
38 var unreadElem = chatElem.children[0].children[0].children[1].children[1].children[1]; 38 var unreadElem = chatElem.children[0].children[0].children[1].children[1].children[1];
39 39
40 var countValue = parseInt(unreadElem.textContent) || 0; // Returns 0 in case of isNaN 40 var countValue = parseInt(unreadElem.textContent) || 0; // Returns 0 in case of isNaN
41 41
42 if (unreadElem.querySelectorAll("[data-icon=muted]").length === 0) { 42 if (unreadElem.querySelectorAll("[data-icon=muted]").length === 0) {
43 count += countValue; 43 count += countValue;
44 } else { 44 } else {
45 indirectCount += countValue; 45 indirectCount += countValue;
46 } 46 }
47 } 47 }
48 48
49 Franz.setBadge(count, indirectCount); 49 Franz.setBadge(count, indirectCount);
50 }; 50 };
51 51