mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-25 12:02:13 +00:00
show keyboard attempts
This commit is contained in:
@@ -108,6 +108,7 @@ struct ChatInfoView: View {
|
||||
@State var contact: Contact
|
||||
@State var localAlias: String
|
||||
@Binding var makeCall: CallMediaType?
|
||||
@Binding var chatViewKeyboardVisible: Bool
|
||||
@State private var connectionStats: ConnectionStats? = nil
|
||||
@State private var customUserProfile: Profile? = nil
|
||||
@State private var connectionCode: String? = nil
|
||||
@@ -407,7 +408,11 @@ struct ChatInfoView: View {
|
||||
.onTapGesture {
|
||||
if openedFromChatView {
|
||||
dismiss()
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
chatViewKeyboardVisible = true
|
||||
}
|
||||
} else {
|
||||
chatModel.openChatAction = .message
|
||||
chatModel.chatId = chat.id
|
||||
}
|
||||
}
|
||||
@@ -713,7 +718,8 @@ struct ChatInfoView_Previews: PreviewProvider {
|
||||
chat: Chat(chatInfo: ChatInfo.sampleData.direct, chatItems: []),
|
||||
contact: Contact.sampleData,
|
||||
localAlias: "",
|
||||
makeCall: Binding.constant(nil)
|
||||
makeCall: Binding.constant(nil),
|
||||
chatViewKeyboardVisible: Binding.constant(false)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,8 @@ struct ChatView: View {
|
||||
chat: chat,
|
||||
contact: contact,
|
||||
localAlias: chat.chatInfo.localAlias,
|
||||
makeCall: $makeCall
|
||||
makeCall: $makeCall,
|
||||
chatViewKeyboardVisible: $keyboardVisible
|
||||
)
|
||||
}
|
||||
} else if case let .group(groupInfo) = cInfo {
|
||||
@@ -258,8 +259,12 @@ struct ChatView: View {
|
||||
}
|
||||
}
|
||||
switch chatModel.openChatAction {
|
||||
case .some(.message): ()
|
||||
case let .some(.call(media)): makeCall = media
|
||||
case .some(.message):
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
keyboardVisible = true
|
||||
}
|
||||
case let .some(.call(media)):
|
||||
makeCall = media
|
||||
case .none: ()
|
||||
}
|
||||
chatModel.openChatAction = nil
|
||||
|
||||
@@ -35,7 +35,8 @@ struct ContactListNavLink: View {
|
||||
chat: chat,
|
||||
contact: contact,
|
||||
localAlias: chat.chatInfo.localAlias,
|
||||
makeCall: Binding.constant(nil)
|
||||
makeCall: Binding.constant(nil),
|
||||
chatViewKeyboardVisible: Binding.constant(false)
|
||||
)
|
||||
} label: {
|
||||
HStack{
|
||||
|
||||
Reference in New Issue
Block a user