From daaa93b6e456bcec5b57a04c7f278343e534c9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 29 Sep 2022 10:42:32 -0400 Subject: [PATCH] feat: add action:unread.updateCount --- public/src/client/header/unread.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/src/client/header/unread.js b/public/src/client/header/unread.js index 40e8e143cf..79eb0513cb 100644 --- a/public/src/client/header/unread.js +++ b/public/src/client/header/unread.js @@ -1,6 +1,6 @@ 'use strict'; -define('forum/header/unread', function () { +define('forum/header/unread', ['hooks'], function (hooks) { const unread = {}; const watchStates = { ignoring: 1, @@ -89,6 +89,8 @@ define('forum/header/unread', function () { .attr('data-content', count > 99 ? '99+' : count); $('#mobile-menu [data-unread-url="' + url + '"]').attr('data-content', count > 99 ? '99+' : count); + + hooks.fire('action:unread.updateCount', { url, count }); } unread.updateUnreadTopicCount = updateUnreadTopicCount;