Skip to content

Commit 1ecdb67

Browse files
authored
Fix Channel List stuck in Empty View State in rare conditions (#639)
* Do not make loading view dependent of network reachability * Fix not updating the channels after the sync call * Update CHANGELOG.md
1 parent c8d13cc commit 1ecdb67

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
88
### 🐞 Fixed
99
- Fix crash when opening message overlay in iPad with a TabBar [#627](https://github.com/GetStream/stream-chat-swiftui/pull/627)
1010
- Only show Leave Group option if the user has leave-channel permission [#633](https://github.com/GetStream/stream-chat-swiftui/pull/633)
11+
- Fix Channel List stuck in Empty View State in rare conditions [#639](https://github.com/GetStream/stream-chat-swiftui/pull/639)
1112

1213
# [4.65.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.65.0)
1314
_October 18, 2024_

Sources/StreamChatSwiftUI/ChatChannelList/ChatChannelListViewModel.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,7 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController
310310

311311
updateChannels()
312312

313-
if channels.isEmpty {
314-
loading = networkReachability.isNetworkAvailable()
315-
}
313+
loading = channels.isEmpty
316314

317315
controller?.synchronize { [weak self] error in
318316
guard let self = self else { return }
@@ -322,9 +320,7 @@ open class ChatChannelListViewModel: ObservableObject, ChatChannelListController
322320
self.channelAlertType = .error
323321
} else {
324322
// access channels
325-
if self.selectedChannel == nil {
326-
self.updateChannels()
327-
}
323+
self.updateChannels()
328324
self.checkForDeeplinks()
329325
}
330326
}

0 commit comments

Comments
 (0)