Skip to content

Commit

Permalink
add typing
Browse files Browse the repository at this point in the history
  • Loading branch information
dena-sohrabi committed Dec 26, 2024
1 parent af51d2a commit 90f16a1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apple/InlineIOS/Chat/ChatView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,16 @@ struct ChatView: View {
text: $text,
height: $textViewHeight
)

.frame(height: textViewHeight)
.background(.clear)
.onChange(of: text) { newText in
if newText.isEmpty {
Task { await ComposeActions.shared.stoppedTyping(for: peer) }
} else {
Task { await ComposeActions.shared.startedTyping(for: peer) }
}
}
if text.isEmpty {
Text("Write a message")
.foregroundStyle(.tertiary)
Expand Down

0 comments on commit 90f16a1

Please sign in to comment.