Bump SDK version and fix breaking changes. (#709)

This commit is contained in:
Doug 2023-03-20 18:26:07 +00:00 committed by GitHub
parent efdb47a98a
commit 66651c0f34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 22 deletions

View File

@ -95,8 +95,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/matrix-org/matrix-rust-components-swift",
"state" : {
"revision" : "6e9c8b7f0f68fd8e617e9d6c1ad902736899557a",
"version" : "1.0.46-alpha"
"revision" : "cc68dbd95a35a481a7398e7cc324e26917fd4022",
"version" : "1.0.47-alpha"
}
},
{

View File

@ -72,8 +72,8 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
.sink { [weak self] roomSummaryProviderState, totalCount, rooms in
guard let self else { return }
let isLoadingData = roomSummaryProviderState != .live && (totalCount == 0 || rooms.count != totalCount)
let hasNoRooms = roomSummaryProviderState == .live && totalCount == 0
let isLoadingData = roomSummaryProviderState != .fullyLoaded && (totalCount == 0 || rooms.count != totalCount)
let hasNoRooms = roomSummaryProviderState == .fullyLoaded && totalCount == 0
var roomListMode = self.state.roomListMode
if isLoadingData {
@ -269,7 +269,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
}
private func updateVisibleRange(_ range: Range<Int>, timelineLimit: UInt) {
guard visibleRoomsSummaryProvider?.statePublisher.value == .live,
guard visibleRoomsSummaryProvider?.statePublisher.value == .fullyLoaded,
!range.isEmpty else { return }
guard let visibleRoomsSummaryProvider else {

View File

@ -23,7 +23,7 @@ private class SlidingSyncViewObserver: SlidingSyncListRoomListObserver, SlidingS
let roomListDiffPublisher = PassthroughSubject<SlidingSyncListRoomsListDiff, Never>()
/// Publishes the current state of sliding sync, such as whether its catching up or live.
let stateUpdatePublisher = CurrentValueSubject<SlidingSyncState, Never>(.cold)
let stateUpdatePublisher = CurrentValueSubject<SlidingSyncState, Never>(.fullyLoaded)
/// Publishes the number of available rooms
let countUpdatePublisher = CurrentValueSubject<UInt, Never>(0)

View File

@ -35,11 +35,11 @@ class MockRoomSummaryProvider: RoomSummaryProviderProtocol {
switch state {
case .loading:
roomListPublisher = .init([])
statePublisher = .init(.cold)
statePublisher = .init(.notLoaded)
countPublisher = .init(0)
case .loaded:
roomListPublisher = .init(Self.rooms)
statePublisher = .init(.live)
statePublisher = .init(.fullyLoaded)
countPublisher = .init(UInt(Self.rooms.count))
}
}

View File

@ -26,7 +26,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
private var cancellables = Set<AnyCancellable>()
let roomListPublisher = CurrentValueSubject<[RoomSummary], Never>([])
let statePublisher = CurrentValueSubject<RoomSummaryProviderState, Never>(.cold)
let statePublisher = CurrentValueSubject<RoomSummaryProviderState, Never>(.notLoaded)
let countPublisher = CurrentValueSubject<UInt, Never>(0)
private var rooms: [RoomSummary] = [] {
@ -220,14 +220,14 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
extension RoomSummaryProviderState {
init(slidingSyncState: SlidingSyncState) {
switch slidingSyncState {
case .cold:
self = .cold
case .preload:
self = .preload
case .catchingUp:
self = .catchingUp
case .live:
self = .live
case .notLoaded:
self = .notLoaded
case .preloaded:
self = .preloaded
case .partiallyLoaded:
self = .partiallyLoaded
case .fullyLoaded:
self = .fullyLoaded
}
}
}

View File

@ -19,10 +19,10 @@ import Foundation
import MatrixRustSDK
enum RoomSummaryProviderState {
case cold
case preload
case catchingUp
case live
case notLoaded
case preloaded
case partiallyLoaded
case fullyLoaded
}
enum RoomSummary: CustomStringConvertible {

1
changelog.d/709.change Normal file
View File

@ -0,0 +1 @@
Bump SDK version and fix breaking changes.

View File

@ -42,7 +42,7 @@ include:
packages:
MatrixRustSDK:
url: https://github.com/matrix-org/matrix-rust-components-swift
exactVersion: 1.0.46-alpha
exactVersion: 1.0.47-alpha
# path: ../matrix-rust-sdk
DesignKit:
path: DesignKit