Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not watch channels when searching by channels #3472

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

# Upcoming

## StreamChat
### 🐞 Fixed
- Fix watching channels when performing channel search [#3472](https://github.com/GetStream/stream-chat-swift/pull/3472)

## StreamChatUI
### ✅ Added
- Open `shouldMarkThreadRead` and `shouldMarkChannelRead` [#3468](https://github.com/GetStream/stream-chat-swift/pull/3468)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ open class ChatChannelSearchVC: ChatChannelListSearchVC {
override open func loadSearchResults(with text: String) {
guard let currentUserId = controller.client.currentUserId else { return }

replaceQuery(.init(
var searchChannelsQuery = ChannelListQuery(
filter: .and([
.autocomplete(.name, text: text),
.containMembers(userIds: [currentUserId])
])
))
)
// Do not watch the query when searching.
searchChannelsQuery.options = []

replaceQuery(searchChannelsQuery)
}

override open func loadMoreSearchResults() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ final class ChatChannelSearchVC_Tests: XCTestCase {
vc.controller.query.filter.filterHash,
"(name AUTOCOMPLETE Dummy) AND (members IN [\"\(currentUserId)\"])"
)
XCTAssertTrue(vc.controller.query.options.isEmpty)
}

func test_loadMoreSearchResults() {
Expand Down
Loading