aboutsummaryrefslogtreecommitdiffstats
path: root/src/web
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-12-29 12:55:36 -0600
committerJP Dillingham <jp@dillingham.me>2022-12-29 12:55:36 -0600
commit300d8e182317e44fe83376044e543058ad087c42 (patch)
tree56928852dec57714fca7b856db19ccdc139e9d9a /src/web
parentdfb87bdbee091f389f8c5606d3b214f19add8491 (diff)
downloadslskd-300d8e182317e44fe83376044e543058ad087c42.tar.gz
fix menu
Diffstat (limited to 'src/web')
-rw-r--r--src/web/src/components/Chat/ChatMenu.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/web/src/components/Chat/ChatMenu.js b/src/web/src/components/Chat/ChatMenu.js
index 971646f4..3dd91763 100644
--- a/src/web/src/components/Chat/ChatMenu.js
+++ b/src/web/src/components/Chat/ChatMenu.js
@@ -8,12 +8,6 @@ import SendMessageModal from './SendMessageModal';
const ChatMenu = ({ conversations, active, onConversationChange, ...rest }) => {
const names = Object.keys(conversations);
-
- const unread = Object.entries(conversations).reduce((acc, [name, messages]) => {
- acc[name] = messages.filter(message => !message.acknowledged);
- return acc;
- }, {});
-
const isActive = (name) => active === name;
return (
@@ -28,8 +22,8 @@ const ChatMenu = ({ conversations, active, onConversationChange, ...rest }) => {
>
<Icon name='circle' size='tiny' color='green'/>
{name}
- {(unread[name] || []).length === 0 ? '' :
- <Label size='tiny' color='red'>{(unread[name] || []).length}</Label>
+ {conversations[name].hasUnAcknowledgedMessages &&
+ <Label size='tiny' color='red'>{conversations[name].unAcknowledgedMessageCount}</Label>
}
</Menu.Item>
)}