Use a static room summary provider to resolve room summaries through id and aliases (#3863)

* trying to debug why sometimes the value

is missing even if it appears in the room list

* static room provider implementation

* set the page size through the init

* removed reset filters on .cancel

since using the sop function is safer
This commit is contained in:
Mauro
2025-03-04 14:08:15 +01:00
committed by GitHub
parent 56d8af1d2e
commit 319441d527
16 changed files with 179 additions and 60 deletions
@@ -53,4 +53,8 @@ final class MessageForwardingScreenCoordinator: CoordinatorProtocol {
func toPresentable() -> AnyView {
AnyView(MessageForwardingScreen(context: viewModel.context))
}
func stop() {
viewModel.stop()
}
}
@@ -60,7 +60,6 @@ class MessageForwardingScreenViewModel: MessageForwardingScreenViewModelType, Me
switch viewAction {
case .cancel:
actionsSubject.send(.dismiss)
roomSummaryProvider.setFilter(.all(filters: []))
case .send:
Task { await forward() }
case .selectRoom(let roomID):
@@ -72,6 +71,11 @@ class MessageForwardingScreenViewModel: MessageForwardingScreenViewModelType, Me
}
}
func stop() {
// This is a shared provider so we should reset the filtering when we are done with the view
roomSummaryProvider.setFilter(.all(filters: []))
}
// MARK: - Private
private func updateRooms() {
@@ -11,4 +11,6 @@ import Combine
protocol MessageForwardingScreenViewModelProtocol {
var actions: AnyPublisher<MessageForwardingScreenViewModelAction, Never> { get }
var context: MessageForwardingScreenViewModelType.Context { get }
func stop()
}