diff --git a/src/composables/useChatMentions.ts b/src/composables/useChatMentions.ts index 37a6394f75a..bb184995d15 100644 --- a/src/composables/useChatMentions.ts +++ b/src/composables/useChatMentions.ts @@ -52,7 +52,11 @@ function useChatMentionsComposable(token: Ref): ReturnType { * @param isDarkTheme whether current theme is dark */ function parseMention(possibleMention: ChatMention, token: string, isDarkTheme: boolean): AutocompleteChatMention { - const chatMention: AutocompleteChatMention = { ...possibleMention, status: undefined } + const chatMention: AutocompleteChatMention = { + ...possibleMention, + id: possibleMention.mentionId ?? possibleMention.id, // mentionId should be the default match since 'federation-v1' + status: undefined, + } // Set icon for candidate mentions that are not for users. if (possibleMention.source === 'calls') { @@ -85,13 +89,11 @@ function useChatMentionsComposable(token: Ref): ReturnType { } } - // mentionId should be the default match since 'federation-v1' - const id = possibleMention.mentionId ?? possibleMention.id // caching the user id data for each possible mention if (!userDataTokenMap.value[token]) { Vue.set(userDataTokenMap.value, token, {}) } - Vue.set(userDataTokenMap.value[token], id, chatMention) + Vue.set(userDataTokenMap.value[token], chatMention.id, chatMention) return chatMention } diff --git a/src/composables/useDocumentTitle.ts b/src/composables/useDocumentTitle.ts index cbb9d5c6b8e..3c2da1034a2 100644 --- a/src/composables/useDocumentTitle.ts +++ b/src/composables/useDocumentTitle.ts @@ -43,7 +43,7 @@ export function useDocumentTitle() { * - a conversation has a different last message id then previously */ const shouldShowAsterisk = Object.keys(newLastMessageMap).some(token => { - return !savedLastMessageMap.value[token] // Conversation is new + return savedLastMessageMap.value[token] === undefined // Conversation is new || (savedLastMessageMap.value[token] !== newLastMessageMap[token] // Last message changed && newLastMessageMap[token] !== -1) // But is not from the current user })