ui: fix connecting to group with member review (#6072)

This commit is contained in:
spaced4ndy
2025-07-15 08:01:05 +00:00
committed by GitHub
parent 1e73eb512a
commit 0a722cbe2a
3 changed files with 17 additions and 4 deletions

View File

@@ -2481,10 +2481,15 @@ func processReceivedMsg(_ res: ChatEvent) async {
await MainActor.run {
m.updateGroup(groupInfo)
}
if m.chatId == groupInfo.id,
case .memberSupport(nil) = m.secondaryIM?.groupScopeInfo {
await MainActor.run {
m.secondaryPendingInviteeChatOpened = false
if m.chatId == groupInfo.id {
if groupInfo.membership.memberPending {
await MainActor.run {
m.secondaryPendingInviteeChatOpened = true
}
} else if case .memberSupport(nil) = m.secondaryIM?.groupScopeInfo {
await MainActor.run {
m.secondaryPendingInviteeChatOpened = false
}
}
}
}

View File

@@ -290,6 +290,13 @@ struct ChatView: View {
}
}
}
.onChange(of: chatModel.secondaryPendingInviteeChatOpened) { secondaryChatOpened in
if secondaryChatOpened {
ItemsModel.loadSecondaryChat(chat.id, chatFilter: .groupChatScopeContext(groupScopeInfo: userSupportScopeInfo)) {
showUserSupportChatSheet = true
}
}
}
.onChange(of: chatModel.chatId) { cId in
ConnectProgressManager.shared.cancelConnectProgress()
showChatInfoSheet = false

View File

@@ -2872,6 +2872,7 @@ object ChatController {
}
if (
chatModel.chatId.value == r.groupInfo.id
&& !r.groupInfo.membership.memberPending
&& ModalManager.end.hasModalOpen(ModalViewId.SECONDARY_CHAT)
&& chatModel.secondaryChatsContext.value?.secondaryContextFilter is SecondaryContextFilter.GroupChatScopeContext
) {