Browse Source

Merge pull request #1453 from Ash258/patch-1

Fix WhatsApp unread counter
pull/1484/head
Ramiro Saenz 7 years ago committed by GitHub
parent
commit
180472e929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/store/ServicesList.js

2
app/store/ServicesList.js

@ -28,7 +28,7 @@ Ext.define('Rambox.store.ServicesList', {
,description: locale['services[0]'] ,description: locale['services[0]']
,url: 'https://web.whatsapp.com/' ,url: 'https://web.whatsapp.com/'
,type: 'messaging' ,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 ,dont_update_unread_from_title: true
}, },
{ {

Loading…
Cancel
Save