Browse Source

Update ServicesList.js

Count only notifications in side panel. Prevent counting notification in scroll button.

Fixes #2289.
pull/2310/head
Juan Manuel Gonzalez Alama 6 years ago
parent
commit
8687b2486d
  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(){const elements = document.querySelectorAll(\'.P6z4j, .unread\');let count = 0;for (let i = 0; i < elements.length; i++) {if (elements[i].parentNode.parentNode.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);(async()=>{try{const a=await window.navigator.serviceWorker.getRegistrations();for(const b of a)b.unregister()}catch(a){}})();' ,js_unread: 'function checkUnread(){const elements = document.querySelectorAll(\'#pane-side .P6z4j, .unread\');let count = 0;for (let i = 0; i < elements.length; i++) {if (elements[i].parentNode.parentNode.querySelectorAll(\'#pane-side *[data-icon="muted"]\').length === 0) {count++;}}updateBadge(count);}function updateBadge(count){if(count && count>=1){rambox.setUnreadCount(count);}else{rambox.clearUnreadCount();}}setInterval(checkUnread, 1e3);(async()=>{try{const a=await window.navigator.serviceWorker.getRegistrations();for(const b of a)b.unregister()}catch(a){}})();'
}, },
{ {
id: 'slack' id: 'slack'

Loading…
Cancel
Save