From 481da048051b44b8e46f7422941b503b5172ac97 Mon Sep 17 00:00:00 2001 From: Jakob Struye Date: Sun, 22 Jul 2018 18:08:22 +0200 Subject: [PATCH] =?UTF-8?q?Setting=20"=E2=80=A2"=20as=20unread=20count=20n?= =?UTF-8?q?ow=20possible=20from=20js=5Funread,=20updated=20Slack=20js=5Fun?= =?UTF-8?q?read=20to=20do=20this.=20TODO=20add=20for=20other=20services=20?= =?UTF-8?q?with=20"=E2=80=A2".?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/ServicesList.js | 2 +- app/ux/WebView.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/store/ServicesList.js b/app/store/ServicesList.js index 0e9ef819..3fe2d703 100644 --- a/app/store/ServicesList.js +++ b/app/store/ServicesList.js @@ -37,7 +37,7 @@ Ext.define('Rambox.store.ServicesList', { ,description: locale['services[1]'] ,url: 'https://___.slack.com/' ,type: 'messaging' - ,js_unread: 'function checkUnread(){var e=$(".p-channel_sidebar__channel--unread:not(.p-channel_sidebar__channel--muted)").length,a=0;$(".p-channel_sidebar__badge").each(function(){a+=isNaN(parseInt($(this).html()))?0:parseInt($(this).html())}),updateBadge(e,a)}function updateBadge(e,a){var n=a>0?"("+a+") ":e>0?"(•) ":"";document.title=n+originalTitle}var originalTitle=document.title;setInterval(checkUnread,3e3);' + ,js_unread: 'function checkUnread(){var e=$(".p-channel_sidebar__channel--unread:not(.p-channel_sidebar__channel--muted)").length,n=0;$(".p-channel_sidebar__badge").each(function(){n+=isNaN(parseInt($(this).html()))?0:parseInt($(this).html())}),count=0 0) { var count = event.args[0]; - if (count === parseInt(count, 10)) { + if (count === parseInt(count, 10) || "•" === count) { me.setUnreadCount(count); } }