mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
fixed an issue where threads would not do the initial focus and an issue where the timeline did throw an error by mistake
This commit is contained in:
+4
-3
@@ -21,15 +21,16 @@ struct TimelineControllerFactory: TimelineControllerFactoryProtocol {
|
||||
appSettings: ServiceLocator.shared.settings)
|
||||
}
|
||||
|
||||
func buildThreadTimelineController(eventID: String,
|
||||
func buildThreadTimelineController(threadRootEventID: String,
|
||||
initialFocussedEventID: String?,
|
||||
roomProxy: JoinedRoomProxyProtocol,
|
||||
timelineItemFactory: RoomTimelineItemFactoryProtocol,
|
||||
mediaProvider: MediaProviderProtocol) async -> Result<TimelineControllerProtocol, TimelineFactoryControllerError> {
|
||||
switch await roomProxy.threadTimeline(eventID: eventID) {
|
||||
switch await roomProxy.threadTimeline(eventID: threadRootEventID) {
|
||||
case .success(let timelineProxy):
|
||||
return .success(TimelineController(roomProxy: roomProxy,
|
||||
timelineProxy: timelineProxy,
|
||||
initialFocussedEventID: nil,
|
||||
initialFocussedEventID: initialFocussedEventID,
|
||||
timelineItemFactory: timelineItemFactory,
|
||||
mediaProvider: mediaProvider,
|
||||
appSettings: ServiceLocator.shared.settings))
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@ protocol TimelineControllerFactoryProtocol {
|
||||
timelineItemFactory: RoomTimelineItemFactoryProtocol,
|
||||
mediaProvider: MediaProviderProtocol) -> TimelineControllerProtocol
|
||||
|
||||
func buildThreadTimelineController(eventID: String,
|
||||
func buildThreadTimelineController(threadRootEventID: String,
|
||||
initialFocussedEventID: String?,
|
||||
roomProxy: JoinedRoomProxyProtocol,
|
||||
timelineItemFactory: RoomTimelineItemFactoryProtocol,
|
||||
mediaProvider: MediaProviderProtocol) async -> Result<TimelineControllerProtocol, TimelineFactoryControllerError>
|
||||
|
||||
@@ -135,10 +135,8 @@ final class TimelineProxy: TimelineProxyProtocol {
|
||||
}
|
||||
|
||||
// This extra check is necessary as detached timelines don't support subscribing to pagination status.
|
||||
// We need it to make sure we send a valid status after a failure.
|
||||
guard subject.value == .idle else {
|
||||
MXLog.error("Attempting to paginate \(direction.rawValue) when already at the end.")
|
||||
return .failure(.failedPaginatingEndReached)
|
||||
return .success(())
|
||||
}
|
||||
|
||||
MXLog.info("Paginating \(direction.rawValue)")
|
||||
|
||||
@@ -47,7 +47,6 @@ enum TimelineProxyError: Error {
|
||||
case sdkError(Error)
|
||||
|
||||
case failedRedacting
|
||||
case failedPaginatingEndReached
|
||||
}
|
||||
|
||||
/// Element X proxies generally wrap the counterpart RustSDK objects while providing platform specific
|
||||
|
||||
Reference in New Issue
Block a user