Skip to content

Commit c257010

Browse files
Updating channel list before screen appearance
1 parent 166487e commit c257010

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListViewModel.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController
126126
///
127127
/// - Parameter index: the currently displayed index.
128128
public func checkForChannels(index: Int) {
129-
checkTabBarVisibilty()
129+
handleChannelAppearance()
130130

131131
if index < (controller?.channels.count ?? 0) - 15 {
132132
return
@@ -339,11 +339,14 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController
339339
}
340340
}
341341

342-
private func checkTabBarVisibilty() {
342+
private func handleChannelAppearance() {
343343
guard #available(iOS 15, *) else { return }
344344
if hideTabBar == true {
345345
hideTabBar = false
346346
}
347+
if !queuedChannelsChanges.isEmpty {
348+
channels = queuedChannelsChanges
349+
}
347350
}
348351
}
349352

0 commit comments

Comments
 (0)