diff --git a/app/store/ServicesList.js b/app/store/ServicesList.js index f04d4e6a..6626bd59 100644 --- a/app/store/ServicesList.js +++ b/app/store/ServicesList.js @@ -36,7 +36,7 @@ Ext.define('Rambox.store.ServicesList', { ,description: 'Slack brings all your communication together in one place. It’s real-time messaging, archiving and search for modern teams.' ,url: 'https://___.slack.com/' ,type: 'messaging' - ,js_unread: 'function checkUnread(){var a=0,b=0;$(".unread_msgs").each(function(){a+=parseInt($(this).html())}),$(".unread_highlights").each(function(){b+=parseInt($(this).html())}),updateBadge(a,b)}function updateBadge(a,b){var c=b>0?"("+b+") ":a>0?"(•) ":"";document.title=c.originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' + ,js_unread: 'function checkUnread(){var a=0,b=0;$(".unread_msgs").each(function(){a+=parseInt($(this).html())}),$(".unread_highlights").each(function(){b+=parseInt($(this).html())}),updateBadge(a,b)}function updateBadge(a,b){var c=b>0?"("+b+") ":a>0?"(•) ":"";document.title=c+originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' }, { id: 'noysi' diff --git a/app/ux/WebView.js b/app/ux/WebView.js index 1b1adeee..aa45e4ba 100644 --- a/app/ux/WebView.js +++ b/app/ux/WebView.js @@ -179,8 +179,8 @@ Ext.define('Rambox.ux.WebView',{ webview.addEventListener("page-title-updated", function(e) { var count = e.title.match(/\(([^)]+)\)/); // Get text between (...) count = count ? count[1] : '0'; - count = Ext.isArray(count.match(/\d+/g)) ? count.match(/\d+/g).join("") : count.match(/\d+/g); // Some services have special characters. Example: (•) - count = count ? parseInt(count) : 0; + count = count === '•' ? count : Ext.isArray(count.match(/\d+/g)) ? count.match(/\d+/g).join("") : count.match(/\d+/g); // Some services have special characters. Example: (•) + count = count === null ? '0' : count; var formattedCount = Rambox.util.Format.formatNumber(count);