From b8af5e94248f2e054eaf43849030f73433c2597d Mon Sep 17 00:00:00 2001 From: Christian Pedersen Date: Thu, 23 Nov 2017 10:03:40 +0100 Subject: [PATCH 1/2] Add unread count to Intercom --- app/store/ServicesList.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/store/ServicesList.js b/app/store/ServicesList.js index 90b03ce0..22f15a5d 100644 --- a/app/store/ServicesList.js +++ b/app/store/ServicesList.js @@ -821,6 +821,8 @@ Ext.define('Rambox.store.ServicesList', { ,description: 'Intercom makes it easy to communicate with your customers personally, at scale. Designed to feel like the messaging apps you use every day, Intercom lets you talk to consumers almost anywhere: inside your app, on your website, across social media and via email.' ,url: 'https://app.intercom.io' ,type: 'messaging' + ,js_unread: 'function checkUnread(){var a=document.getElementsByClassName("unread")[0];updateBadge(t=parseInt(a.textContent.replace(/[^0-9]/g,"")))}function updateBadge(a){a>=1?rambox.setUnreadCount(a):rambox.clearUnreadCount()}setInterval(checkUnread,3000);' + ,dont_update_unread_from_title: true }, { id: 'allo' From 3f020a193198f3bcd143cb14d076ce211528e0e3 Mon Sep 17 00:00:00 2001 From: Christian Pedersen Date: Fri, 24 Nov 2017 09:14:01 +0100 Subject: [PATCH 2/2] Fix textContent on undefined --- app/store/ServicesList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store/ServicesList.js b/app/store/ServicesList.js index 22f15a5d..78026cfe 100644 --- a/app/store/ServicesList.js +++ b/app/store/ServicesList.js @@ -821,7 +821,7 @@ Ext.define('Rambox.store.ServicesList', { ,description: 'Intercom makes it easy to communicate with your customers personally, at scale. Designed to feel like the messaging apps you use every day, Intercom lets you talk to consumers almost anywhere: inside your app, on your website, across social media and via email.' ,url: 'https://app.intercom.io' ,type: 'messaging' - ,js_unread: 'function checkUnread(){var a=document.getElementsByClassName("unread")[0];updateBadge(t=parseInt(a.textContent.replace(/[^0-9]/g,"")))}function updateBadge(a){a>=1?rambox.setUnreadCount(a):rambox.clearUnreadCount()}setInterval(checkUnread,3000);' + ,js_unread: 'function checkUnread(){var a=document.getElementsByClassName("unread")[0];updateBadge(t=a===undefined?0:parseInt(a.textContent.replace(/[^0-9]/g,"")))}function updateBadge(a){a>=1?rambox.setUnreadCount(a):rambox.clearUnreadCount()}setInterval(checkUnread,3000);' ,dont_update_unread_from_title: true }, {