Skip to content

Commit b5cbcb9

Browse files
Fixed typing indicator not shown when empty message list
1 parent 33859dc commit b5cbcb9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1111

1212
### 🐞 Fixed
1313
- Scroll to bottom when return key is pressed in the composer input view
14+
- Typing indicator not shown when empty message list
1415

1516
# [4.23.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.23.0)
1617
_October 27, 2022_

Sources/StreamChatSwiftUI/ChatChannel/ChatChannelView.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import SwiftUI
99
public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
1010
@Injected(\.colors) private var colors
1111
@Injected(\.utils) private var utils
12+
@Injected(\.chatClient) private var chatClient
1213

1314
@StateObject private var viewModel: ChatChannelViewModel
1415

@@ -69,7 +70,15 @@ public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
6970
: nil
7071
)
7172
} else {
72-
factory.makeEmptyMessagesView(for: channel, colors: colors)
73+
ZStack {
74+
factory.makeEmptyMessagesView(for: channel, colors: colors)
75+
if viewModel.shouldShowTypingIndicator {
76+
factory.makeTypingIndicatorBottomView(
77+
channel: channel,
78+
currentUserId: chatClient.currentUserId
79+
)
80+
}
81+
}
7382
}
7483

7584
Divider()

0 commit comments

Comments
 (0)