mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Periphery cleanup (#5893)
This commit is contained in:
@@ -13,7 +13,6 @@ struct StartChatScreenCoordinatorParameters {
|
||||
let userSession: UserSessionProtocol
|
||||
let userDiscoveryService: UserDiscoveryServiceProtocol
|
||||
let userIndicatorController: UserIndicatorControllerProtocol
|
||||
let appSettings: AppSettings
|
||||
let analytics: AnalyticsServiceProtocol
|
||||
}
|
||||
|
||||
@@ -25,7 +24,6 @@ enum StartChatScreenCoordinatorAction {
|
||||
}
|
||||
|
||||
final class StartChatScreenCoordinator: CoordinatorProtocol {
|
||||
private let parameters: StartChatScreenCoordinatorParameters
|
||||
private var viewModel: StartChatScreenViewModelProtocol
|
||||
private var cancellables = Set<AnyCancellable>()
|
||||
|
||||
@@ -35,13 +33,10 @@ final class StartChatScreenCoordinator: CoordinatorProtocol {
|
||||
}
|
||||
|
||||
init(parameters: StartChatScreenCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
|
||||
viewModel = StartChatScreenViewModel(userSession: parameters.userSession,
|
||||
analytics: parameters.analytics,
|
||||
userIndicatorController: parameters.userIndicatorController,
|
||||
userDiscoveryService: parameters.userDiscoveryService,
|
||||
appSettings: parameters.appSettings)
|
||||
userDiscoveryService: parameters.userDiscoveryService)
|
||||
}
|
||||
|
||||
func start() {
|
||||
|
||||
@@ -10,7 +10,6 @@ import Foundation
|
||||
|
||||
enum StartChatScreenErrorType: Error {
|
||||
case failedCreatingRoom
|
||||
case unknown
|
||||
}
|
||||
|
||||
enum StartChatScreenViewModelAction: Equatable {
|
||||
|
||||
@@ -17,7 +17,6 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
private let analytics: AnalyticsServiceProtocol
|
||||
private let userIndicatorController: UserIndicatorControllerProtocol
|
||||
private let userDiscoveryService: UserDiscoveryServiceProtocol
|
||||
private let appSettings: AppSettings
|
||||
|
||||
private var suggestedUsers = [UserProfile]()
|
||||
|
||||
@@ -29,13 +28,11 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
init(userSession: UserSessionProtocol,
|
||||
analytics: AnalyticsServiceProtocol,
|
||||
userIndicatorController: UserIndicatorControllerProtocol,
|
||||
userDiscoveryService: UserDiscoveryServiceProtocol,
|
||||
appSettings: AppSettings) {
|
||||
userDiscoveryService: UserDiscoveryServiceProtocol) {
|
||||
self.userSession = userSession
|
||||
self.analytics = analytics
|
||||
self.userIndicatorController = userIndicatorController
|
||||
self.userDiscoveryService = userDiscoveryService
|
||||
self.appSettings = appSettings
|
||||
|
||||
super.init(initialViewState: StartChatScreenViewState(userID: userSession.clientProxy.userID), mediaProvider: userSession.mediaProvider)
|
||||
|
||||
@@ -92,7 +89,6 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
// periphery:ignore - auto cancels when reassigned
|
||||
@CancellableTask private var resolveAliasTask: Task<Void, Never>?
|
||||
private var internalRoomAddressState: JoinByAddressState = .example
|
||||
|
||||
@@ -162,7 +158,6 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
}
|
||||
}
|
||||
|
||||
// periphery:ignore - auto cancels when reassigned
|
||||
@CancellableTask
|
||||
private var fetchUsersTask: Task<Void, Never>?
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@ import SwiftUI
|
||||
struct JoinRoomByAddressView: View {
|
||||
@ObservedObject var context: StartChatScreenViewModel.Context
|
||||
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
@State private var sheetHeight: CGFloat = .zero
|
||||
@FocusState private var textFieldFocus
|
||||
private let topPadding: CGFloat = 22
|
||||
@@ -87,8 +85,7 @@ struct JoinRoomByAddressView_Previews: PreviewProvider, TestablePreview {
|
||||
return StartChatScreenViewModel(userSession: userSession,
|
||||
analytics: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
userDiscoveryService: userDiscoveryService,
|
||||
appSettings: .volatile())
|
||||
userDiscoveryService: userDiscoveryService)
|
||||
}()
|
||||
|
||||
static var previews: some View {
|
||||
|
||||
@@ -161,8 +161,7 @@ struct StartChatScreen_Previews: PreviewProvider, TestablePreview {
|
||||
return StartChatScreenViewModel(userSession: userSession,
|
||||
analytics: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
userDiscoveryService: userDiscoveryService,
|
||||
appSettings: appSettings)
|
||||
userDiscoveryService: userDiscoveryService)
|
||||
}()
|
||||
|
||||
static var previews: some View {
|
||||
|
||||
Reference in New Issue
Block a user