mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-24 08:45:31 +00:00
complete
This commit is contained in:
@@ -15,6 +15,7 @@ private let memberImageSize: CGFloat = 34
|
||||
struct ChatView: View {
|
||||
@EnvironmentObject var chatModel: ChatModel
|
||||
@Environment(\.colorScheme) var colorScheme
|
||||
@Environment(\.dismiss) var dismiss
|
||||
@State @ObservedObject var chat: Chat
|
||||
@State private var showChatInfoSheet: Bool = false
|
||||
@State private var showAddMembersSheet: Bool = false
|
||||
@@ -70,6 +71,9 @@ struct ChatView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.onChange(of: chatModel.chatId) { _ in
|
||||
if chatModel.chatId == nil { dismiss() }
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button {
|
||||
|
||||
@@ -17,7 +17,7 @@ struct ChatListView: View {
|
||||
@State private var showAddChat = false
|
||||
|
||||
var body: some View {
|
||||
NavStackWorkaround(isPresented: Binding(get: { chatModel.chatId != nil }, set: { _ in }), destination: chatView) {
|
||||
NavStackWorkaround(path: Binding(get: { ChatModel.shared.chatId != nil ? [true] : [] }, set: { _ in }), destination: chatView) {
|
||||
VStack {
|
||||
if chatModel.chats.isEmpty {
|
||||
onboardingButtons()
|
||||
@@ -74,17 +74,6 @@ struct ChatListView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.background(
|
||||
ProcessInfo().operatingSystemVersion.majorVersion < 16
|
||||
? NavigationLink(
|
||||
destination: chatView(),
|
||||
isActive: Binding(
|
||||
get: { chatModel.chatId != nil },
|
||||
set: { _ in }
|
||||
)
|
||||
) { EmptyView() }
|
||||
: nil
|
||||
)
|
||||
}
|
||||
|
||||
private func onboardingButtons() -> some View {
|
||||
|
||||
Reference in New Issue
Block a user