diff --git a/apps/ios/Shared/Model/SimpleXAPI.swift b/apps/ios/Shared/Model/SimpleXAPI.swift index f184e048cc..adda443a3b 100644 --- a/apps/ios/Shared/Model/SimpleXAPI.swift +++ b/apps/ios/Shared/Model/SimpleXAPI.swift @@ -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 + } } } } diff --git a/apps/ios/Shared/Views/Chat/ChatView.swift b/apps/ios/Shared/Views/Chat/ChatView.swift index ed0c0aa432..30eb6b7fee 100644 --- a/apps/ios/Shared/Views/Chat/ChatView.swift +++ b/apps/ios/Shared/Views/Chat/ChatView.swift @@ -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 diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt index 769efecad8..ee41e9cbda 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/SimpleXAPI.kt @@ -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 ) {