Periphery cleanup (#5893)

This commit is contained in:
Mauro
2026-07-20 11:16:11 +02:00
committed by GitHub
parent 175aca596e
commit 9093631f8b
275 changed files with 381 additions and 2268 deletions
@@ -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 {