Browse Source

Merge pull request #1988 from noerw/fix/mattermost-unread

Fix/mattermost unread
pull/1997/head
Ramiro Saenz 6 years ago committed by GitHub
parent
commit
1feca8d954
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/store/ServicesList.js

2
app/store/ServicesList.js

@ -331,7 +331,7 @@ Ext.define('Rambox.store.ServicesList', {
,description: locale['services[32]'] ,description: locale['services[32]']
,url: '___' ,url: '___'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'function checkUnread(){var a=document.title.match(/\(([^()]+)\)/);a=isNaN(parseInt(a))?"*"===document.title[0]?"\u2022":"0":parseInt(a[1]),updateBadge(a)}function updateBadge(a){1<=a||"\u2022"===a?rambox.setUnreadCount(a):rambox.clearUnreadCount()}setInterval(checkUnread,3e3);' ,js_unread: 'function checkUnread() {const selectBadges = "#sidebarChannelContainer .unread-title.has-badge > span.badge"; const pmUnread = Array.from(document.querySelectorAll(selectBadges)) .reduce((total, el) => total += parseInt(el.innerText), 0); if (pmUnread) return updateBadge(pmUnread); const channelsUnread = document.querySelectorAll("#sidebarChannelContainer .unread-title:not(.has-badge)").length; const teamsUnread = document.querySelectorAll(".team-sidebar .team-container.unread").length; updateBadge((channelsUnread + teamsUnread) > 0); } function updateBadge(count) {if (count === true) rambox.setUnreadCount("•"); else if (count >= 1) rambox.setUnreadCount(count); else rambox.clearUnreadCount(); } setInterval(checkUnread, 3e3);'
}, },
{ {
id: 'dingtalk' id: 'dingtalk'

Loading…
Cancel
Save