From 59d6bb7cfb4331c057b72865c23fa29ce8963250 Mon Sep 17 00:00:00 2001 From: Ash258 Date: Wed, 14 Feb 2018 21:41:12 +0100 Subject: [PATCH] Fix WhatsApp unread counter Close #1446 --- app/store/ServicesList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store/ServicesList.js b/app/store/ServicesList.js index 20b2bc90..65e3d027 100644 --- a/app/store/ServicesList.js +++ b/app/store/ServicesList.js @@ -28,7 +28,7 @@ Ext.define('Rambox.store.ServicesList', { ,description: locale['services[0]'] ,url: 'https://web.whatsapp.com/' ,type: 'messaging' - ,js_unread: 'function checkUnread(){var i=0;document.querySelectorAll(".unread").forEach(function(e){0===e.querySelectorAll("[data-icon=muted]").length&&i++});updateBadge(i)}function updateBadge(count) { if (count && count >= 1) { rambox.setUnreadCount(count); } else { rambox.clearUnreadCount(); } }setInterval(checkUnread,1e3);' + ,js_unread: 'function checkUnread(){const elements = document.querySelectorAll(\'.CxUIE, .unread\');let count = 0;for (let i = 0; i < elements.length; i++) {if (elements[i].querySelectorAll(\'*[data-icon="muted"]\').length === 0) {count++;}}updateBadge(count);}function updateBadge(count){if(count && count>=1){rambox.setUnreadCount(count);}else{rambox.clearUnreadCount();}}setInterval(checkUnread, 1e3);' ,dont_update_unread_from_title: true }, {