Refactor how drafts are handled on a coordinator level and add support for them on thread timelines.

This commit is contained in:
Stefan Ceriu
2025-06-13 15:11:20 +03:00
committed by Stefan Ceriu
parent eaf14eaaac
commit 6fc6df9375
6 changed files with 33 additions and 16 deletions
@@ -74,8 +74,6 @@ final class ThreadTimelineScreenCoordinator: CoordinatorProtocol {
maxExpandedHeight: ComposerConstant.maxHeight,
parserStyle: .elementX)
#warning("Drafts are not handled and they can't be without rust side changes")
composerViewModel = ComposerToolbarViewModel(initialText: nil,
roomProxy: parameters.roomProxy,
isInThread: true,
@@ -144,9 +142,14 @@ final class ThreadTimelineScreenCoordinator: CoordinatorProtocol {
timelineViewModel.process(composerAction: action)
}
.store(in: &cancellables)
// Loading the draft requires the subscriptions to be set up first otherwise
// the room won't be be able to propagate the information to the composer.
composerViewModel.start()
}
func stop() {
composerViewModel.stop()
viewModel.stop()
}