diff --git a/CHANGELOG.md b/CHANGELOG.md index bc07d600..34c776cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### 🐞 Fixed - Fix crash when opening message overlay in iPad with a TabBar [#627](https://github.com/GetStream/stream-chat-swiftui/pull/627) - Only show Leave Group option if the user has leave-channel permission [#633](https://github.com/GetStream/stream-chat-swiftui/pull/633) +- Fix Channel List stuck in Empty View State in rare conditions [#639](https://github.com/GetStream/stream-chat-swiftui/pull/639) # [4.65.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.65.0) _October 18, 2024_ diff --git a/Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListViewModel.swift b/Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListViewModel.swift index fd3f580f..3ac38037 100644 --- a/Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListViewModel.swift +++ b/Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListViewModel.swift @@ -310,9 +310,7 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController updateChannels() - if channels.isEmpty { - loading = networkReachability.isNetworkAvailable() - } + loading = channels.isEmpty controller?.synchronize { [weak self] error in guard let self = self else { return } @@ -322,9 +320,7 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController self.channelAlertType = .error } else { // access channels - if self.selectedChannel == nil { - self.updateChannels() - } + self.updateChannels() self.checkForDeeplinks() } }