Skip to content

Commit

Permalink
Updated StreamChat dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmitrevski committed Jul 19, 2024
1 parent 1ed5722 commit f8c0959
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

# Upcoming

### 🔄 Changed
### ✅ Added
- Public init of PhotoAttachmentCell [#544](https://github.com/GetStream/stream-chat-swiftui/pull/544)
- Public init for AudioRecordingInfo [547](https://github.com/GetStream/stream-chat-swiftui/pull/547)

### 🐞 Fixed
- Update of search results when slowly typing [#550](https://github.com/GetStream/stream-chat-swiftui/issues/550)

# [4.59.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.59.0)
_July 10, 2024_
Expand Down
2 changes: 0 additions & 2 deletions DemoAppSwiftUI/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ class AppDelegate: NSObject, UIApplicationDelegate {
streamChat = StreamChat(chatClient: chatClient, utils: utils)
*/

StreamRuntimeCheck._isBackgroundMappingEnabled = true

#if RELEASE
// We're tracking Crash Reports / Issues from the Demo App to keep improving the SDK
SentrySDK.start { options in
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.59.0"),
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.60.0"),
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import SwiftUI
import UIKit

/// View model for the `ChatChannelListView`.
open class ChatChannelListViewModel: ObservableObject, ChatChannelListControllerDelegate {
open class ChatChannelListViewModel: ObservableObject, ChatChannelListControllerDelegate, ChatMessageSearchControllerDelegate {

/// Context provided dependencies.
@Injected(\.chatClient) private var chatClient: ChatClient
@Injected(\.images) private var images: Images
Expand Down Expand Up @@ -103,7 +104,9 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController

@Published public var searchText = "" {
didSet {
handleSearchTextChange()
if searchText != oldValue {
handleSearchTextChange()
}
}
}

Expand Down Expand Up @@ -244,6 +247,12 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController
selectedChannel = channels.first?.channelSelectionInfo
}
}

// MARK: - ChatMessageSearchControllerDelegate

public func controller(_ controller: ChatMessageSearchController, didChangeMessages changes: [ListChange<ChatMessage>]) {
updateSearchResults()
}

// MARK: - private

Expand Down Expand Up @@ -324,6 +333,7 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController
if !searchText.isEmpty {
guard let userId = chatClient.currentUserId else { return }
messageSearchController = chatClient.messageSearchController()
messageSearchController?.delegate = self
let query = MessageSearchQuery(
channelFilter: .containMembers(userIds: [userId]),
messageFilter: .autocomplete(.text, text: searchText)
Expand All @@ -334,6 +344,7 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController
self?.updateSearchResults()
})
} else {
messageSearchController?.delegate = nil
messageSearchController = nil
searchResults = []
updateChannels()
Expand Down
2 changes: 1 addition & 1 deletion StreamChatSwiftUI-XCFramework.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Pod::Spec.new do |spec|

spec.framework = 'Foundation', 'UIKit', 'SwiftUI'

spec.dependency 'StreamChat-XCFramework', '~> 4.59.0'
spec.dependency 'StreamChat-XCFramework', '~> 4.60.0'

spec.cocoapods_version = '>= 1.11.0'
end
2 changes: 1 addition & 1 deletion StreamChatSwiftUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Pod::Spec.new do |spec|

spec.framework = 'Foundation', 'UIKit', 'SwiftUI'

spec.dependency 'StreamChat', '~> 4.59.0'
spec.dependency 'StreamChat', '~> 4.60.0'
end
2 changes: 1 addition & 1 deletion StreamChatSwiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3705,7 +3705,7 @@
repositoryURL = "https://github.com/GetStream/stream-chat-swift.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.59.0;
minimumVersion = 4.60.0;
};
};
E3A1C01A282BAC66002D1E26 /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
Expand Down

0 comments on commit f8c0959

Please sign in to comment.