mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Cleaned up various things, mostly removed unnecessary selfs, comments and bad formatting
This commit is contained in:
committed by
Stefan Ceriu
parent
c073dfd95d
commit
eac1401cc1
+10
-15
@@ -23,14 +23,9 @@ struct UserSessionOverviewCoordinatorParameters {
|
||||
}
|
||||
|
||||
final class UserSessionOverviewCoordinator: Coordinator, Presentable {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private let parameters: UserSessionOverviewCoordinatorParameters
|
||||
private let userSessionOverviewHostingController: UIViewController
|
||||
private var userSessionOverviewViewModel: UserSessionOverviewViewModelProtocol
|
||||
private let hostingController: UIViewController
|
||||
private var viewModel: UserSessionOverviewViewModelProtocol
|
||||
|
||||
private var indicatorPresenter: UserIndicatorTypePresenterProtocol
|
||||
private var loadingIndicator: UserIndicator?
|
||||
@@ -45,20 +40,20 @@ final class UserSessionOverviewCoordinator: Coordinator, Presentable {
|
||||
|
||||
init(parameters: UserSessionOverviewCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
let viewModel = UserSessionOverviewViewModel(userSessionInfo: parameters.userSessionInfo,
|
||||
isCurrentSession: parameters.isCurrentSession)
|
||||
let view = UserSessionOverview(viewModel: viewModel.context)
|
||||
userSessionOverviewViewModel = viewModel
|
||||
userSessionOverviewHostingController = VectorHostingController(rootView: view)
|
||||
|
||||
viewModel = UserSessionOverviewViewModel(userSessionInfo: parameters.userSessionInfo,
|
||||
isCurrentSession: parameters.isCurrentSession)
|
||||
|
||||
indicatorPresenter = UserIndicatorTypePresenter(presentingViewController: userSessionOverviewHostingController)
|
||||
hostingController = VectorHostingController(rootView: UserSessionOverview(viewModel: viewModel.context))
|
||||
|
||||
indicatorPresenter = UserIndicatorTypePresenter(presentingViewController: hostingController)
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
func start() {
|
||||
MXLog.debug("[UserSessionOverviewCoordinator] did start.")
|
||||
userSessionOverviewViewModel.completion = { [weak self] result in
|
||||
viewModel.completion = { [weak self] result in
|
||||
guard let self = self else { return }
|
||||
MXLog.debug("[UserSessionOverviewCoordinator] UserSessionOverviewViewModel did complete with result: \(result).")
|
||||
switch result {
|
||||
@@ -71,7 +66,7 @@ final class UserSessionOverviewCoordinator: Coordinator, Presentable {
|
||||
}
|
||||
|
||||
func toPresentable() -> UIViewController {
|
||||
return self.userSessionOverviewHostingController
|
||||
return hostingController
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
+1
-5
@@ -60,10 +60,6 @@ enum MockUserSessionOverviewScreenState: MockScreenState, CaseIterable {
|
||||
}
|
||||
|
||||
// can simulate service and viewModel actions here if needs be.
|
||||
|
||||
return (
|
||||
[viewModel],
|
||||
AnyView(UserSessionOverview(viewModel: viewModel.context))
|
||||
)
|
||||
return ([viewModel], AnyView(UserSessionOverview(viewModel: viewModel.context)))
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -18,7 +18,6 @@ import XCTest
|
||||
import RiotSwiftUI
|
||||
|
||||
class UserSessionOverviewUITests: MockScreenTestCase {
|
||||
|
||||
func test_whenCurrentSessionSelected_correctNavTittleDisplayed() {
|
||||
app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.currentSession.title)
|
||||
let navTitle = VectorL10n.userSessionOverviewCurrentSessionTitle
|
||||
|
||||
-1
@@ -20,7 +20,6 @@ import Combine
|
||||
@testable import RiotSwiftUI
|
||||
|
||||
class UserSessionOverviewViewModelTests: XCTestCase {
|
||||
|
||||
var sut: UserSessionOverviewViewModel!
|
||||
|
||||
func test_whenVerifyCurrentSessionProcessed_completionWithVerifyCurrentSessionCalled() {
|
||||
|
||||
-7
@@ -21,17 +21,10 @@ typealias UserSessionOverviewViewModelType = StateStoreViewModel<UserSessionOver
|
||||
UserSessionOverviewViewAction>
|
||||
|
||||
class UserSessionOverviewViewModel: UserSessionOverviewViewModelType, UserSessionOverviewViewModelProtocol {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
private let userSessionInfo: UserSessionInfo
|
||||
// MARK: Public
|
||||
|
||||
var completion: ((UserSessionOverviewViewModelResult) -> Void)?
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(userSessionInfo: UserSessionInfo, isCurrentSession: Bool) {
|
||||
self.userSessionInfo = userSessionInfo
|
||||
|
||||
|
||||
-1
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
|
||||
protocol UserSessionOverviewViewModelProtocol {
|
||||
|
||||
var completion: ((UserSessionOverviewViewModelResult) -> Void)? { get set }
|
||||
var context: UserSessionOverviewViewModelType.Context { get }
|
||||
}
|
||||
|
||||
@@ -17,15 +17,8 @@
|
||||
import SwiftUI
|
||||
|
||||
struct UserSessionOverview: View {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@ObservedObject var viewModel: UserSessionOverviewViewModel.Context
|
||||
|
||||
var body: some View {
|
||||
|
||||
-1
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
|
||||
struct UserSessionOverviewDisclosureCell: View {
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
let title: String
|
||||
|
||||
Reference in New Issue
Block a user