ui: fix messages being sent in wrong scope after receiving an item in support scope (#5903)

This commit is contained in:
spaced4ndy
2025-05-13 14:01:53 +00:00
committed by GitHub
parent db1ffb2cf2
commit b81e5b13b3
2 changed files with 7 additions and 1 deletions
+5 -1
View File
@@ -499,7 +499,11 @@ final class ChatModel: ObservableObject {
func updateChatInfo(_ cInfo: ChatInfo) {
if let i = getChatIndex(cInfo.id) {
chats[i].chatInfo = cInfo
if case let .group(groupInfo, groupChatScope) = cInfo, groupChatScope != nil {
chats[i].chatInfo = .group(groupInfo: groupInfo, groupChatScope: nil)
} else {
chats[i].chatInfo = cInfo
}
chats[i].created = Date.now
}
}
@@ -355,6 +355,8 @@ object ChatModel {
)
)
}
} else if (currentCInfo is ChatInfo.Group && newCInfo is ChatInfo.Group && newCInfo.groupChatScope != null) {
newCInfo = newCInfo.copy(groupInfo = newCInfo.groupInfo, groupChatScope = null)
}
chats[i] = chats[i].copy(chatInfo = newCInfo)
}