mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Generating SDK Mocks through the usage of swift run tools generate-sdk-mocks (#982)
* basic implementation, that works for now only with the local SDK * replaced a handmade mock with a generated mock
This commit is contained in:
@@ -40,8 +40,8 @@ final class StartChatScreenCoordinator: CoordinatorProtocol {
|
||||
createRoomParameters.asCurrentValuePublisher()
|
||||
}
|
||||
|
||||
private let selectedUsers = CurrentValueSubject<[UserProfile], Never>([])
|
||||
private var selectedUsersPublisher: CurrentValuePublisher<[UserProfile], Never> {
|
||||
private let selectedUsers = CurrentValueSubject<[UserProfileProxy], Never>([])
|
||||
private var selectedUsersPublisher: CurrentValuePublisher<[UserProfileProxy], Never> {
|
||||
selectedUsers.asCurrentValuePublisher()
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ final class StartChatScreenCoordinator: CoordinatorProtocol {
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func toggleUser(_ user: UserProfile) {
|
||||
private func toggleUser(_ user: UserProfileProxy) {
|
||||
var selectedUsers = selectedUsers.value
|
||||
if let index = selectedUsers.firstIndex(where: { $0.userID == user.userID }) {
|
||||
selectedUsers.remove(at: index)
|
||||
|
||||
@@ -51,5 +51,5 @@ struct StartChatScreenViewStateBindings {
|
||||
enum StartChatScreenViewAction {
|
||||
case close
|
||||
case createRoom
|
||||
case selectUser(UserProfile)
|
||||
case selectUser(UserProfileProxy)
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
}
|
||||
}
|
||||
|
||||
private func handleResult(for sectionType: UserDiscoverySectionType, result: Result<[UserProfile], UserDiscoveryErrorType>) {
|
||||
private func handleResult(for sectionType: UserDiscoverySectionType, result: Result<[UserProfileProxy], UserDiscoveryErrorType>) {
|
||||
switch result {
|
||||
case .success(let users):
|
||||
state.usersSection = .init(type: sectionType, users: users)
|
||||
@@ -126,7 +126,7 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
}
|
||||
}
|
||||
|
||||
private func createDirectRoom(with user: UserProfile) async {
|
||||
private func createDirectRoom(with user: UserProfileProxy) async {
|
||||
defer {
|
||||
hideLoadingIndicator()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user