@@ -12,7 +12,7 @@ import { computed, watch } from 'vue'
1212import LoadingPlaceholder from ' ../../UIShared/LoadingPlaceholder.vue'
1313import ConversationItem from ' ./ConversationItem.vue'
1414import ConversationTagHeader from ' ./ConversationTagHeader.vue'
15- import { AVATAR , CONVERSATION } from ' ../../../constants.ts'
15+ import { AVATAR } from ' ../../../constants.ts'
1616import { useConversationTagsStore } from ' ../../../stores/conversationTags.ts'
1717import { hasCall , hasUnreadMentions , hasUnreadMessages } from ' ../../../utils/conversation.ts'
1818
@@ -56,34 +56,21 @@ const listItems = computed<VirtualListItem[]>(() => {
5656 hasTagged: boolean
5757 favorites: Conversation []
5858 favoritesUnreadCount: number
59- favoritesUnreadMention: boolean
60- favoritesUnreadMentionDirect: boolean
6159 tagged: Record <string , Conversation []>
6260 taggedUnreadCount: Record <string , number >
63- taggedUnreadMention: Record <string , boolean >
64- taggedUnreadMentionDirect: Record <string , boolean >
6561 other: Conversation []
6662 otherUnreadCount: number
67- otherUnreadMention: boolean
68- otherUnreadMentionDirect: boolean
6963 }>((acc , conversation ) => {
70- // Count amount of unread conversations, highlight if any has a direct or group mention
64+ // Count amount of unread conversations
7165 const unreadCount = conversation .unreadMessages ? 1 : 0
72- const unreadMention = conversation .unreadMention
73- const unreadMentionDirect = conversation .unreadMentionDirect
74- || (!! unreadCount && [CONVERSATION .TYPE .ONE_TO_ONE , CONVERSATION .TYPE .ONE_TO_ONE_FORMER ].includes (conversation .type ))
7566 const isTagged = !! conversation .tagIds ?.length
7667
7768 if (conversation .isFavorite ) {
7869 acc .favorites .push (conversation )
7970 acc .favoritesUnreadCount += unreadCount
80- acc .favoritesUnreadMention || = unreadMention
81- acc .favoritesUnreadMentionDirect || = unreadMentionDirect
8271 } else if (! isTagged ) {
8372 acc .other .push (conversation )
8473 acc .otherUnreadCount += unreadCount
85- acc .otherUnreadMention || = unreadMention
86- acc .otherUnreadMentionDirect || = unreadMentionDirect
8774 }
8875
8976 if (isTagged ) {
@@ -96,24 +83,16 @@ const listItems = computed<VirtualListItem[]>(() => {
9683 acc .tagged [tagId ] ?? = []
9784 acc .tagged [tagId ].push (conversation )
9885 acc .taggedUnreadCount [tagId ] = (acc .taggedUnreadCount [tagId ] || 0 ) + unreadCount
99- acc .taggedUnreadMention [tagId ] = acc .taggedUnreadMention [tagId ] || unreadMention
100- acc .taggedUnreadMentionDirect [tagId ] = acc .taggedUnreadMentionDirect [tagId ] || unreadMentionDirect
10186 }
10287 return acc
10388 }, {
10489 hasTagged: false ,
10590 favorites: [],
10691 favoritesUnreadCount: 0 ,
107- favoritesUnreadMention: false ,
108- favoritesUnreadMentionDirect: false ,
10992 tagged: {},
11093 taggedUnreadCount: {},
111- taggedUnreadMention: {},
112- taggedUnreadMentionDirect: {},
11394 other: [],
11495 otherUnreadCount: 0 ,
115- otherUnreadMention: false ,
116- otherUnreadMentionDirect: false ,
11796 })
11897
11998 if (! groupedConversations .hasTagged ) {
@@ -124,8 +103,6 @@ const listItems = computed<VirtualListItem[]>(() => {
124103 tag: ConversationTag
125104 conversations: Conversation []
126105 unreadCount: number
127- unreadMention: boolean
128- unreadMentionDirect: boolean
129106 }>> ((acc , tag ) => {
130107 const conversations = tag .type === ' favorites'
131108 ? groupedConversations .favorites
@@ -142,23 +119,11 @@ const listItems = computed<VirtualListItem[]>(() => {
142119 : tag .type === ' other'
143120 ? groupedConversations .otherUnreadCount
144121 : (groupedConversations .taggedUnreadCount [tag .id ] ?? 0 )
145- const unreadMention = tag .type === ' favorites'
146- ? groupedConversations .favoritesUnreadMention
147- : tag .type === ' other'
148- ? groupedConversations .otherUnreadMention
149- : (groupedConversations .taggedUnreadMention [tag .id ] ?? false )
150- const unreadMentionDirect = tag .type === ' favorites'
151- ? groupedConversations .favoritesUnreadMentionDirect
152- : tag .type === ' other'
153- ? groupedConversations .otherUnreadMentionDirect
154- : (groupedConversations .taggedUnreadMentionDirect [tag .id ] ?? false )
155122
156123 acc .push ({
157124 tag ,
158125 conversations ,
159126 unreadCount ,
160- unreadMention ,
161- unreadMentionDirect ,
162127 })
163128 return acc
164129 }, [])
@@ -168,8 +133,6 @@ const listItems = computed<VirtualListItem[]>(() => {
168133 ... section .tag ,
169134 _type: ' tag-header' ,
170135 unreadCount: section .unreadCount ,
171- unreadMention: section .unreadMention ,
172- unreadMentionDirect: section .unreadMentionDirect ,
173136 isFirst: index === 0 ,
174137 isLast: index === renderedSections .length - 1 ,
175138 }
0 commit comments