From b5a13d22c356c1e1cb91236a1224220b68a2c2c2 Mon Sep 17 00:00:00 2001 From: TheGoddessInari Date: Thu, 3 Oct 2019 16:57:25 -0700 Subject: [PATCH] Fix WhatsApp js_unread. This is thanks to the great information from Athurius. --- 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 df709218..56fbb76a 100644 --- a/app/store/ServicesList.js +++ b/app/store/ServicesList.js @@ -28,7 +28,7 @@ Ext.define('Hamsket.store.ServicesList', { ,description: locale['services[0]'] ,url: 'https://web.whatsapp.com/' ,type: 'messaging' - ,js_unread: `let checkUnread=()=>{const elements=document.querySelectorAll(".P6z4j, .unread");let count=0;for(let i of elements)0===i.querySelectorAll('*[data-icon="muted"]').length&&count++;hamsket.updateBadge(count)};setInterval(checkUnread,1e3);let unregister_queue=[];navigator.serviceWorker.getRegistrations().then(registrations=>{for(const registration of registrations)unregister_queue.push(registration.unregister());return unregister_queue}).then(queue=>{}).catch(err=>{});` + ,js_unread: `let checkUnread=()=>{const elements=document.querySelectorAll("#pane-side .P6z4j, .unread");let count=0;for(const i of elements){const gp=i.parentNode.parentNode;0===gp.querySelectorAll('#pane-side *[data-icon="muted"]').length&&count++}hamsket.updateBadge(count)};setInterval(checkUnread,1e3);let unregister_queue=[];navigator.serviceWorker.getRegistrations().then(registrations=>{for(const registration of registrations)unregister_queue.push(registration.unregister());return unregister_queue}).then(queue=>{}).catch(err=>{});` }, { id: 'slack'