From 79d8bd205be0879d3914fe926eaced3629caa4a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Horus=20Lugo=20L=C3=B3pez?= Date: Tue, 27 Jul 2021 10:20:01 +0200 Subject: [PATCH 1/2] Replace NEW! with the total count of unread messages --- src/libs/UnreadIndicatorUpdater/updateUnread/index.website.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/UnreadIndicatorUpdater/updateUnread/index.website.js b/src/libs/UnreadIndicatorUpdater/updateUnread/index.website.js index aca9134a16a..75f6d3f31d0 100644 --- a/src/libs/UnreadIndicatorUpdater/updateUnread/index.website.js +++ b/src/libs/UnreadIndicatorUpdater/updateUnread/index.website.js @@ -10,7 +10,7 @@ import CONFIG from '../../../CONFIG'; */ function updateUnread(totalCount) { const hasUnread = totalCount !== 0; - document.title = hasUnread ? `(NEW!) ${CONFIG.SITE_TITLE}` : CONFIG.SITE_TITLE; + document.title = hasUnread ? `(${totalCount}) ${CONFIG.SITE_TITLE}` : CONFIG.SITE_TITLE; document.getElementById('favicon').href = hasUnread ? CONFIG.FAVICON.UNREAD : CONFIG.FAVICON.DEFAULT; } From 62bf8f58910423f9938c161f06bd658d0411e6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Horus=20Lugo=20L=C3=B3pez?= Date: Tue, 27 Jul 2021 10:56:26 +0200 Subject: [PATCH 2/2] Wait for the next tick to ensure that the unread indicator is set to 0 in the SignInPage component --- src/pages/signin/SignInPage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/signin/SignInPage.js b/src/pages/signin/SignInPage.js index dd12cdf992b..7af84f55867 100644 --- a/src/pages/signin/SignInPage.js +++ b/src/pages/signin/SignInPage.js @@ -53,7 +53,8 @@ const defaultProps = { class SignInPage extends Component { componentDidMount() { // Always reset the unread counter to zero on this page - updateUnread(0); + // NOTE: We need to wait for the next tick to ensure that the unread indicator is updated + setTimeout(() => updateUnread(0), 0); } render() {