mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-22 03:40:17 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user