Skip to content

Commit 717448c

Browse files
Fixed PR comments
1 parent 612d508 commit 717448c

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Sources/StreamChatSwiftUI/ChatChannel/ChatChannelViewModel.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ open class ChatChannelViewModel: ObservableObject, MessagesDataSource {
8888

8989
@Published public var reactionsShown = false {
9090
didSet {
91+
// When reactions are shown, the navigation bar is hidden.
92+
// Check the header type and trigger an update.
9193
checkHeaderType()
9294
}
9395
}
@@ -271,11 +273,13 @@ open class ChatChannelViewModel: ObservableObject, MessagesDataSource {
271273

272274
private func checkHeaderType() {
273275
let type: ChannelHeaderType
276+
let typingUsers = channel.currentlyTypingUsersFiltered(
277+
currentUserId: chatClient.currentUserId
278+
)
279+
274280
if !reactionsShown && isMessageThread {
275281
type = .messageThread
276-
} else if !channel.currentlyTypingUsersFiltered(
277-
currentUserId: chatClient.currentUserId
278-
).isEmpty {
282+
} else if !typingUsers.isEmpty {
279283
type = .typingIndicator
280284
} else {
281285
type = .regular

Sources/StreamChatSwiftUI/Resources/en.lproj/Localizable.stringsdict

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>zero</key>
1616
<string> is typing</string>
1717
<key>one</key>
18-
<string> and %2$d more is typing</string>
18+
<string> and %2$d more are typing</string>
1919
<key>other</key>
2020
<string> and %2$d more are typing</string>
2121
</dict>

StreamChatSwiftUITests/Tests/ChatChannel/ChatChannelExtensions_Tests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ class ChatChannelExtensions_Tests: XCTestCase {
6565

6666
// Then
6767
XCTAssert(
68-
typingIndicatorString == "Stefan and 1 more is typing"
69-
|| typingIndicatorString == "Martin and 1 more is typing"
68+
typingIndicatorString == "Stefan and 1 more are typing"
69+
|| typingIndicatorString == "Martin and 1 more are typing"
7070
) // Any of the names can appear first.
7171
}
7272
}

0 commit comments

Comments
 (0)