#1108 - Prevent invites from stealing away the roomList's state listener

This commit is contained in:
Stefan Ceriu
2023-06-19 10:16:12 +03:00
committed by Stefan Ceriu
parent 1b90060c9e
commit ef4346fa08
4 changed files with 21 additions and 17 deletions
@@ -58,6 +58,9 @@ enum RoomSummary: CustomStringConvertible {
}
protocol RoomSummaryProviderProtocol {
typealias EntriesFunction = (RoomListEntriesListener) async throws -> RoomListEntriesResult
typealias LoadingStateFunction = (SlidingSyncListStateObserver) async throws -> RoomListEntriesLoadingStateResult
/// Publishes the currently available room summaries
var roomListPublisher: CurrentValuePublisher<[RoomSummary], Never> { get }
@@ -66,8 +69,8 @@ protocol RoomSummaryProviderProtocol {
/// A separate subscription method is needed instead of running this in the constructor because the invites list is added later on the Rust side.
/// Wanted to be able to build the InvitesSummaryProvider directly instead of having to inform the HomeScreenViewModel about it later
func subscribeIfNecessary(entriesFunction: (RoomListEntriesListener) async throws -> RoomListEntriesResult,
entriesLoadingStateFunction: (SlidingSyncListStateObserver) async throws -> RoomListEntriesLoadingStateResult) async
func subscribeIfNecessary(entriesFunction: EntriesFunction,
entriesLoadingStateFunction: LoadingStateFunction?) async
func updateVisibleRange(_ range: Range<Int>)
}