mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-20 14:10:15 +02:00
feat: add action:chat.updateCount client side hook
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
define('forum/header/chat', ['components'], function (components) {
|
||||
define('forum/header/chat', ['components', 'hooks'], function (components, hooks) {
|
||||
const chat = {};
|
||||
|
||||
chat.prepareDOM = function () {
|
||||
@@ -31,6 +31,7 @@ define('forum/header/chat', ['components'], function (components) {
|
||||
components.get('chat/icon')
|
||||
.toggleClass('unread-count', count > 0)
|
||||
.attr('data-content', count > 99 ? '99+' : count);
|
||||
hooks.fire('action:chat.updateCount', { count });
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user