Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable30] fix: minor regression fixes #13800

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/composables/useChatMentions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ function useChatMentionsComposable(token: Ref<string>): 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') {
Expand Down Expand Up @@ -85,13 +89,11 @@ function useChatMentionsComposable(token: Ref<string>): 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
}
Expand Down
2 changes: 1 addition & 1 deletion src/composables/useDocumentTitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down
Loading