Skip to content

Commit 753ef67

Browse files
authored
Updated StreamChat dependency to 4.65.0 (#625)
* Updated StreamChat dependency to 4.65.0 * Format code according to swiftformat * Fix Tests * One more * Fix demo app linting
1 parent 6c5cfeb commit 753ef67

17 files changed

+63
-63
lines changed

DemoAppSwiftUI/DemoAppSwiftUIApp.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ struct DemoAppSwiftUIApp: App {
2727
case .notLoggedIn:
2828
LoginView()
2929
case .loggedIn:
30-
TabView {
31-
channelListView()
32-
.tabItem { Label("Chat", systemImage: "message") }
33-
.badge(appState.unreadCount.channels)
34-
threadListView()
35-
.tabItem { Label("Threads", systemImage: "text.bubble") }
36-
.badge(appState.unreadCount.threads)
37-
}
30+
TabView {
31+
channelListView()
32+
.tabItem { Label("Chat", systemImage: "message") }
33+
.badge(appState.unreadCount.channels)
34+
threadListView()
35+
.tabItem { Label("Threads", systemImage: "text.bubble") }
36+
.badge(appState.unreadCount.threads)
37+
}
3838
}
3939
}
4040
.onChange(of: appState.userState) { newValue in
@@ -104,7 +104,7 @@ class AppState: ObservableObject, CurrentChatUserControllerDelegate {
104104
private init() {}
105105

106106
func currentUserController(_ controller: CurrentChatUserController, didChangeCurrentUserUnreadCount: UnreadCount) {
107-
self.unreadCount = didChangeCurrentUserUnreadCount
107+
unreadCount = didChangeCurrentUserUnreadCount
108108
let totalUnreadBadge = unreadCount.channels + unreadCount.threads
109109
if #available(iOS 16.0, *) {
110110
UNUserNotificationCenter.current().setBadgeCount(totalUnreadBadge)

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let package = Package(
1616
)
1717
],
1818
dependencies: [
19-
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.64.0"),
19+
.package(url: "https://github.com/GetStream/stream-chat-swift.git", from: "4.65.0"),
2020
],
2121
targets: [
2222
.target(

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListView.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ public struct ChatChannelListView<Factory: ViewFactory>: View {
8181
view.navigationViewStyle(.stack)
8282
})
8383
.background(
84-
isIphone && handleTabBarVisibility ?
85-
Color.clear.background(
86-
TabBarAccessor { tabBar in
87-
self.tabBar = tabBar
88-
}
89-
)
90-
.allowsHitTesting(false)
91-
: nil
92-
)
93-
.onReceive(viewModel.$hideTabBar) { newValue in
94-
if isIphone && handleTabBarVisibility {
95-
self.setupTabBarAppeareance()
96-
self.tabBar?.isHidden = newValue
97-
}
98-
}
99-
.accessibilityIdentifier("ChatChannelListView")
84+
isIphone && handleTabBarVisibility ?
85+
Color.clear.background(
86+
TabBarAccessor { tabBar in
87+
self.tabBar = tabBar
88+
}
89+
)
90+
.allowsHitTesting(false)
91+
: nil
92+
)
93+
.onReceive(viewModel.$hideTabBar) { newValue in
94+
if isIphone && handleTabBarVisibility {
95+
self.setupTabBarAppeareance()
96+
self.tabBar?.isHidden = newValue
97+
}
98+
}
99+
.accessibilityIdentifier("ChatChannelListView")
100100
}
101101

102102
@ViewBuilder

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadList.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public struct ThreadList<Factory: ViewFactory, HeaderView: View, FooterView: Vie
3535
self.factory = factory
3636
self.threads = threads
3737
self.threadDestination = threadDestination
38-
self._selectedThread = selectedThread
38+
_selectedThread = selectedThread
3939
self.onItemTap = onItemTap
4040
self.onItemAppear = onItemAppear
4141
self.headerView = headerView
@@ -49,7 +49,7 @@ public struct ThreadList<Factory: ViewFactory, HeaderView: View, FooterView: Vie
4949
factory: factory,
5050
threads: threads,
5151
threadDestination: threadDestination,
52-
selectedThread: $selectedThread,
52+
selectedThread: $selectedThread,
5353
onItemTap: onItemTap,
5454
onItemAppear: onItemAppear
5555
)
@@ -82,7 +82,7 @@ public struct ThreadsLazyVStack<Factory: ViewFactory>: View {
8282
self.threadDestination = threadDestination
8383
self.onItemTap = onItemTap
8484
self.onItemAppear = onItemAppear
85-
self._selectedThread = selectedThread
85+
_selectedThread = selectedThread
8686
}
8787

8888
public var body: some View {
@@ -93,9 +93,11 @@ public struct ThreadsLazyVStack<Factory: ViewFactory>: View {
9393
threadDestination: threadDestination,
9494
selectedThread: $selectedThread
9595
)
96-
.background(factory.makeThreadListItemBackground(
97-
thread: thread,
98-
isSelected: selectedThread?.id == thread.id)
96+
.background(
97+
factory.makeThreadListItemBackground(
98+
thread: thread,
99+
isSelected: selectedThread?.id == thread.id
100+
)
99101
)
100102
.contentShape(Rectangle())
101103
.onTapGesture {

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListItem.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public struct ChatThreadListItemViewModel {
5151
parentMessageText = threadTitle
5252
} else {
5353
let formatter = InjectedValues[\.utils].messagePreviewFormatter
54-
parentMessageText = formatter.formatContent(for: thread.parentMessage)
54+
parentMessageText = formatter.formatContent(for: thread.parentMessage)
5555
}
5656
return L10n.Thread.Item.repliedTo(parentMessageText.trimmed)
5757
}

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListNavigatableItem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public struct ChatThreadListNavigatableItem<ThreadListItem: View, ThreadDestinat
2424
self.thread = thread
2525
self.threadListItem = threadListItem
2626
self.threadDestination = threadDestination
27-
self._selectedThread = selectedThread
27+
_selectedThread = selectedThread
2828
self.handleTabBarVisibility = handleTabBarVisibility
2929
}
3030

@@ -55,7 +55,7 @@ public struct ThreadSelectionInfo: Identifiable {
5555

5656
public init(thread: ChatThread) {
5757
self.thread = thread
58-
self.id = thread.id
58+
id = thread.id
5959
}
6060
}
6161

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ public struct ChatThreadListContentView<Factory: ViewFactory>: View {
104104
ThreadList(
105105
factory: viewFactory,
106106
threads: viewModel.threads,
107-
threadDestination: viewFactory.makeThreadDestination(),
107+
threadDestination: viewFactory.makeThreadDestination(),
108108
selectedThread: $viewModel.selectedThread,
109109
onItemTap: { thread in
110110
viewModel.selectedThread = .init(thread: thread)
111111
},
112112
onItemAppear: { index in
113113
viewModel.didAppearThread(at: index)
114-
},
114+
},
115115
headerView: {
116116
viewFactory.makeThreadListHeaderView(viewModel: viewModel)
117117
},

Sources/StreamChatSwiftUI/ChatThreadList/ChatThreadListViewModel.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ open class ChatThreadListViewModel: ObservableObject, ChatThreadListControllerDe
5555
@Published public var hasNewThreads: Bool = false
5656

5757
/// The ids of the new threads available to be fetched.
58-
private var newAvailableThreadIds: Set<MessageId> = [] {
59-
didSet {
60-
newThreadsCount = newAvailableThreadIds.count
61-
hasNewThreads = newThreadsCount > 0
62-
}
63-
}
58+
private var newAvailableThreadIds: Set<MessageId> = [] {
59+
didSet {
60+
newThreadsCount = newAvailableThreadIds.count
61+
hasNewThreads = newThreadsCount > 0
62+
}
63+
}
6464

6565
/// Creates a view model for the `ChatThreadListView`.
6666
///

Sources/StreamChatSwiftUI/ChatThreadList/NoThreadsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import SwiftUI
77
/// Default SDK implementation for the view displayed when there are no threads available.
88
public struct NoThreadsView: View {
99

10-
public init () {}
10+
public init() {}
1111

1212
public var body: some View {
1313
NoContentView(

Sources/StreamChatSwiftUI/CommonViews/FloatingBannerViewModifier.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ extension View {
2828
}
2929
}
3030

31-
3231
struct FloatingBannerViewModifier<BannerView: View>: ViewModifier {
3332
let alignment: Alignment
3433
var isPresented: Bool

0 commit comments

Comments
 (0)