From 92365fe15672abe06bcf19a9648114836972ba80 Mon Sep 17 00:00:00 2001 From: Clayton Date: Sun, 7 Jan 2024 18:54:34 -0500 Subject: Update GroupMe DOM filtering to use latest web app conventions (#465) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update filtering to use latest web app conventions * Fix version * fix issue with build (pnpm validate) --------- Co-authored-by: AndreĢ Oliveira --- recipes/groupme/package.json | 2 +- recipes/groupme/webview.js | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'recipes') diff --git a/recipes/groupme/package.json b/recipes/groupme/package.json index f282c9a..06c02b1 100644 --- a/recipes/groupme/package.json +++ b/recipes/groupme/package.json @@ -1,7 +1,7 @@ { "id": "groupme", "name": "GroupMe", - "version": "1.3.0", + "version": "1.3.1", "license": "MIT", "config": { "serviceURL": "https://web.groupme.com", diff --git a/recipes/groupme/webview.js b/recipes/groupme/webview.js index 0f0d3a6..680f12e 100644 --- a/recipes/groupme/webview.js +++ b/recipes/groupme/webview.js @@ -7,20 +7,18 @@ const _path = _interopRequireDefault(require('path')); module.exports = Ferdium => { const getMessages = () => { // array-ify the list of conversations - const allConversations = [ - ...document.querySelectorAll('#tray .tray-list .list-item'), + const unreadConversations = [ + ...document.querySelectorAll('#tray .tray-list .list-item.unread'), ]; // for each conversation on the list... - const filteredConversations = allConversations.filter(e => { - // keep it on the list if [1] it has unread messages (not .ng-hide), and [2] it isn't muted (not .overlay) - return ( - !e.innerHTML.includes('ng-hide') && !e.innerHTML.includes('overlay') - ); + const filteredConversations = unreadConversations.filter(e => { + // keep it on the list if it isn't muted (not .muted) + return !e.innerHTML.includes('muted'); }); - const unreadConversations = filteredConversations.length; + const unreadUnmutedConversations = filteredConversations.length; // set Ferdium badge - Ferdium.setBadge(unreadConversations); + Ferdium.setBadge(unreadUnmutedConversations); }; Ferdium.loop(getMessages); -- cgit v1.2.3-54-g00ecf