From e05d27ea49929e763906e6c430ec79c1a093dde7 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Wed, 26 May 2021 18:10:17 +0530 Subject: Replace 'remote' with 'electron/remote' Bumped up major version for affected recipes to denote breaking changes --- recipes/whatsapp/package.json | 2 +- recipes/whatsapp/webview.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'recipes/whatsapp') 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 @@ { "id": "whatsapp", "name": "WhatsApp", - "version": "2.0.9", + "version": "3.0.0", "description": "WhatsApp", "main": "index.js", "author": "Stefan Malzner ", 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 @@ "use strict"; const { - remote -} = require('electron'); + getCurrentWebContents +} = require('@electron/remote'); const path = require('path'); -const webContents = remote.getCurrentWebContents(); +const webContents = getCurrentWebContents(); const { session } = webContents; @@ -36,16 +36,16 @@ module.exports = Franz => { for (var i = 0; i < chatElems.length; i++) { var chatElem = chatElems[i]; var unreadElem = chatElem.children[0].children[0].children[1].children[1].children[1]; - + var countValue = parseInt(unreadElem.textContent) || 0; // Returns 0 in case of isNaN - + if (unreadElem.querySelectorAll("[data-icon=muted]").length === 0) { count += countValue; } else { indirectCount += countValue; } } - + Franz.setBadge(count, indirectCount); }; -- cgit v1.2.3-70-g09d2