From 0339b399f711c235205f16c1aa3a1a8dd72d8f4e Mon Sep 17 00:00:00 2001 From: Stanislav Dmitrenko <7953703+avently@users.noreply.github.com> Date: Mon, 6 Feb 2023 19:33:45 +0300 Subject: [PATCH] ios: don't go back when system alert appears (#1903) --- apps/ios/Shared/Views/Chat/ChatView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/ios/Shared/Views/Chat/ChatView.swift b/apps/ios/Shared/Views/Chat/ChatView.swift index fe6521129c..3f49f7a47a 100644 --- a/apps/ios/Shared/Views/Chat/ChatView.swift +++ b/apps/ios/Shared/Views/Chat/ChatView.swift @@ -16,6 +16,7 @@ struct ChatView: View { @EnvironmentObject var chatModel: ChatModel @Environment(\.colorScheme) var colorScheme @Environment(\.dismiss) var dismiss + @Environment(\.presentationMode) var presentationMode @State @ObservedObject var chat: Chat @State private var showChatInfoSheet: Bool = false @State private var showAddMembersSheet: Bool = false @@ -77,7 +78,7 @@ struct ChatView: View { if chatModel.chatId == nil { dismiss() } } .onDisappear { - if chatModel.chatId == cInfo.id { + if chatModel.chatId == cInfo.id && !presentationMode.wrappedValue.isPresented { chatModel.chatId = nil DispatchQueue.main.asyncAfter(deadline: .now() + 0.35) { if chatModel.chatId == nil {