-
Notifications
You must be signed in to change notification settings - Fork 90
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
Allow setting searchType dynamically in ChatChannelListViewModel #693
Conversation
89715f4
to
3e722f7
Compare
@@ -393,10 +402,11 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController | |||
/// Creates a new message search controller, sets its delegate, and triggers the search operation. | |||
open func performMessageSearch() { | |||
messageSearchController = chatClient.messageSearchController() | |||
messageSearchController?.delegate = self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved it because otherwise delegate makes a callback with 0 results before sync finishes and this makes the UI to flash.
@@ -433,7 +443,7 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController | |||
return ChannelSelectionInfo( | |||
channel: channel, | |||
message: message, | |||
searchType: .channels | |||
searchType: .messages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI was flickering when changing the search type because incorrect search type was set here.
SDK Size
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅ we just need to fix the changelog
Quality Gate failedFailed conditions |
🔗 Issue Link
Resolves IOS-603
🎯 Goal
Allow setting
searchType
dynamically inChatChannelListViewModel
🛠 Implementation
Make
searchType
public inChatChannelListViewModel
and support reloading search results based on the type.🧪 Testing
For testing purposes I added locally a button for toggling it (ChatChannelListView.swift)
🎨 Changes
☑️ Checklist