mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-06-04 08:11:57 +00:00
message button to open chat
This commit is contained in:
@@ -103,6 +103,7 @@ enum ContactDeleteMode {
|
||||
struct ChatInfoView: View {
|
||||
@EnvironmentObject var chatModel: ChatModel
|
||||
@Environment(\.dismiss) var dismiss: DismissAction
|
||||
var openedFromChatView: Bool
|
||||
@ObservedObject var chat: Chat
|
||||
@State var contact: Contact
|
||||
@State var localAlias: String
|
||||
@@ -401,8 +402,11 @@ struct ChatInfoView: View {
|
||||
|
||||
private func messageButton() -> some View {
|
||||
Button {
|
||||
dismiss()
|
||||
chatModel.chatId = chat.id
|
||||
if openedFromChatView {
|
||||
dismiss()
|
||||
} else {
|
||||
chatModel.chatId = chat.id
|
||||
}
|
||||
} label: {
|
||||
actionButton("message.fill", "message")
|
||||
}
|
||||
@@ -689,6 +693,7 @@ func syncConnectionForceAlert(_ syncConnectionForce: @escaping () -> Void) -> Al
|
||||
struct ChatInfoView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ChatInfoView(
|
||||
openedFromChatView: true,
|
||||
chat: Chat(chatInfo: ChatInfo.sampleData.direct, chatItems: []),
|
||||
contact: Contact.sampleData,
|
||||
localAlias: ""
|
||||
|
||||
@@ -113,7 +113,7 @@ struct ChatView: View {
|
||||
ChatInfoToolbar(chat: chat)
|
||||
}
|
||||
.sheet(isPresented: $showChatInfoSheet) {
|
||||
ChatInfoView(chat: chat, contact: contact, localAlias: chat.chatInfo.localAlias)
|
||||
ChatInfoView(openedFromChatView: true, chat: chat, contact: contact, localAlias: chat.chatInfo.localAlias)
|
||||
}
|
||||
} else if case let .group(groupInfo) = cInfo {
|
||||
Button {
|
||||
|
||||
@@ -31,6 +31,7 @@ struct ContactListNavLink: View {
|
||||
case let .direct(contact):
|
||||
NavigationLink {
|
||||
ChatInfoView(
|
||||
openedFromChatView: false,
|
||||
chat: chat,
|
||||
contact: contact,
|
||||
localAlias: chat.chatInfo.localAlias
|
||||
|
||||
Reference in New Issue
Block a user