mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add the empty state to SpaceScreen. (#4985)
* Rename PaginationState.timelineEndReached to PaginationState.endReached. * Rename PaginationState to TimelinePaginationState. Also renames PaginationStatus to PaginationState so that a TimelinePaginationState consists of the forward and backward pagination states. * Add the empty state to SpaceScreen. Only has 1 of the 2 buttons for now.
This commit is contained in:
@@ -10,22 +10,12 @@ import Combine
|
||||
import Foundation
|
||||
import MatrixRustSDK
|
||||
|
||||
enum PaginationDirection: String {
|
||||
case backwards, forwards
|
||||
}
|
||||
|
||||
enum PaginationStatus {
|
||||
case idle
|
||||
case timelineEndReached
|
||||
case paginating
|
||||
}
|
||||
|
||||
struct PaginationState: Equatable {
|
||||
struct TimelinePaginationState: Equatable {
|
||||
/// An initial state that is used to prevent pagination whilst loading the timeline.
|
||||
/// Once the initial items are loaded the TimelineProxy will publish the correct value.
|
||||
static var initial = PaginationState(backward: .timelineEndReached, forward: .timelineEndReached)
|
||||
let backward: PaginationStatus
|
||||
let forward: PaginationStatus
|
||||
static var initial = TimelinePaginationState(backward: .endReached, forward: .endReached)
|
||||
let backward: PaginationState
|
||||
let forward: PaginationState
|
||||
}
|
||||
|
||||
/// Entities implementing this protocol are responsible for processings diffs coming from the rust timeline
|
||||
@@ -34,11 +24,11 @@ struct PaginationState: Equatable {
|
||||
@MainActor
|
||||
protocol TimelineItemProviderProtocol {
|
||||
/// A publisher that signals when ``itemProxies`` or ``paginationState`` are changed.
|
||||
var updatePublisher: AnyPublisher<([TimelineItemProxy], PaginationState), Never> { get }
|
||||
var updatePublisher: AnyPublisher<([TimelineItemProxy], TimelinePaginationState), Never> { get }
|
||||
/// The current set of items in the timeline.
|
||||
var itemProxies: [TimelineItemProxy] { get }
|
||||
/// Whether the timeline is back/forward paginating or not (or has reached the start/end of the room).
|
||||
var paginationState: PaginationState { get }
|
||||
var paginationState: TimelinePaginationState { get }
|
||||
/// The kind of the timeline
|
||||
var kind: TimelineKind { get }
|
||||
/// A publisher that signals when changes to the room's membership have occurred through `/sync`.
|
||||
|
||||
Reference in New Issue
Block a user