mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-28 23:00:08 +00:00
ios: fix chat not opening when contact connects via 1-time link (#7315)
This commit is contained in:
@@ -1244,6 +1244,15 @@ final class ChatModel: ObservableObject {
|
||||
chats.insert(chat, at: position)
|
||||
}
|
||||
|
||||
func replaceConnReqView(_ id: String, _ withId: ChatId) {
|
||||
if id == showingInvitation?.pcc.id {
|
||||
markShowingInvitationUsed()
|
||||
dismissAllSheets(animated: true) {
|
||||
ItemsModel.shared.loadOpenChat(withId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func dismissConnReqView(_ id: String) {
|
||||
if id == showingInvitation?.pcc.id {
|
||||
markShowingInvitationUsed()
|
||||
|
||||
@@ -2439,7 +2439,7 @@ func processReceivedMsg(_ res: ChatEvent) async {
|
||||
await MainActor.run {
|
||||
m.updateContact(contact)
|
||||
if let conn = contact.activeConn {
|
||||
m.dismissConnReqView(conn.id)
|
||||
m.replaceConnReqView(conn.id, contact.id)
|
||||
m.removeChat(conn.id)
|
||||
}
|
||||
if contact.id == m.chatId, let conn = contact.activeConn {
|
||||
@@ -2456,7 +2456,7 @@ func processReceivedMsg(_ res: ChatEvent) async {
|
||||
await MainActor.run {
|
||||
m.updateContact(contact)
|
||||
if let conn = contact.activeConn {
|
||||
m.dismissConnReqView(conn.id)
|
||||
m.replaceConnReqView(conn.id, contact.id)
|
||||
m.removeChat(conn.id)
|
||||
}
|
||||
}
|
||||
@@ -2466,7 +2466,7 @@ func processReceivedMsg(_ res: ChatEvent) async {
|
||||
await MainActor.run {
|
||||
m.updateContact(contact)
|
||||
if let conn = contact.activeConn {
|
||||
m.dismissConnReqView(conn.id)
|
||||
m.replaceConnReqView(conn.id, contact.id)
|
||||
m.removeChat(conn.id)
|
||||
}
|
||||
}
|
||||
@@ -2616,7 +2616,7 @@ func processReceivedMsg(_ res: ChatEvent) async {
|
||||
await MainActor.run {
|
||||
m.updateGroup(groupInfo)
|
||||
if let conn = hostContact?.activeConn {
|
||||
m.dismissConnReqView(conn.id)
|
||||
m.replaceConnReqView(conn.id, groupInfo.id)
|
||||
m.removeChat(conn.id)
|
||||
}
|
||||
}
|
||||
@@ -2626,7 +2626,7 @@ func processReceivedMsg(_ res: ChatEvent) async {
|
||||
m.updateGroup(groupInfo)
|
||||
_ = m.upsertGroupMember(groupInfo, hostMember)
|
||||
if let hostConn = hostMember.activeConn {
|
||||
m.dismissConnReqView(hostConn.id)
|
||||
m.replaceConnReqView(hostConn.id, groupInfo.id)
|
||||
m.removeChat(hostConn.id)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user