mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add space management to the flows. (#4978)
* Add the menu entries to add/remove rooms to/from a space. * Add a user indicator to SpaceAddRoomsScreen. * Reset the SpaceRoomListProxy after adding/removing any children. * Calm the animations down a bit when entering EditMode on the SpaceScreen.
This commit is contained in:
@@ -22,4 +22,20 @@ protocol SpaceRoomListProxyProtocol {
|
||||
var paginationStatePublisher: CurrentValuePublisher<SpaceRoomListPaginationState, Never> { get }
|
||||
|
||||
func paginate() async
|
||||
func reset() async
|
||||
}
|
||||
|
||||
extension SpaceRoomListProxyProtocol {
|
||||
/// Resets the list and then waits everything to be paginated back in again before returning.
|
||||
///
|
||||
/// **Note:** It's the caller's responsibility to handle the calls to ``paginate``. This method
|
||||
/// purely acts as a helper to wait until the list has reloaded.
|
||||
func resetAndWaitForFullReload(timeout: Duration) async {
|
||||
await reset()
|
||||
|
||||
let runner = ExpiringTaskRunner { [paginationStatePublisher] in
|
||||
await _ = paginationStatePublisher.values.first { $0 == .idle(endReached: true) }
|
||||
}
|
||||
try? await runner.run(timeout: timeout)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user