Don't hold the room list on skeletons for an empty filtered result

The room list keeps showing skeletons while the provider reports loaded
but no summaries have published yet, to avoid flashing an empty list
before the first batch lands. That guard also fired when a filter
(chips, space or search) legitimately matched nothing, leaving the home
screen on placeholders forever instead of showing the empty filter
state.
This commit is contained in:
Stefan Ceriu
2026-09-30 14:41:45 +03:00
parent d3604e8115
commit 4fe58c2d0a
2 changed files with 17 additions and 2 deletions
@@ -334,12 +334,14 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
}
private func updateRoomListMode(with roomSummaryProviderState: RoomSummaryProviderState, hasRooms: Bool) {
let isFiltering = state.bindings.filtersState.isFiltering || state.selectedSpaceFilter != nil || state.bindings.isSearchFieldFocused
let roomListMode: HomeScreenRoomListMode = if !roomSummaryProviderState.isLoaded {
.skeletons // Still loading.
} else if roomSummaryProviderState.totalNumberOfRooms == 0 {
.empty // Loaded, there are no rooms at all.
} else if hasRooms {
.rooms // Loaded and the summaries have published.
} else if hasRooms || isFiltering {
.rooms // Loaded and the summaries have published (or filtered down to nothing).
} else if state.roomListMode == .skeletons {
.skeletons // Loaded but nothing published yet, flipping to .rooms would flash an empty list.
} else {