ios: switch profile without blank chat when opening invitation from notification

Tapping a contact-request notification for another profile switched the
active user but left chatModel.chatId pointing at the previous profile's
open chat, which is absent from the switched profile's chats, so a blank
chat view was shown. Reset chatId on the profile switch so the UI lands on
the switched profile's chat list.
This commit is contained in:
Narasimha-sc
2026-07-21 14:35:54 +00:00
parent afdae36ea3
commit e8fa0b7bf6
+3
View File
@@ -60,6 +60,9 @@ class NtfManager: NSObject, UNUserNotificationCenterDelegate, ObservableObject {
userId != chatModel.currentUser?.userId {
logger.debug("NtfManager.processNotificationResponse changeActiveUser")
changeActiveUser(userId, viewPwd: nil)
// the currently open chat belongs to the previous profile and is absent from the
// switched profile's chats, so drop it to land on the chat list instead of a blank chat view
chatModel.chatId = nil
}
if content.categoryIdentifier == ntfCategoryContactRequest && action == ntfActionAcceptContact,
let chatId = content.userInfo["chatId"] as? String {