mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 03:20:50 +02:00
Removed unnecessary comments from RiotSwiftUI templates, fixed StateStoreViewModel typealias formatting
This commit is contained in:
committed by
Stefan Ceriu
parent
43c28d23b7
commit
fc2fdc8ae7
-8
@@ -18,25 +18,17 @@ import UIKit
|
||||
|
||||
@objcMembers
|
||||
final class TemplateRoomsCoordinator: Coordinator, Presentable {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private let parameters: TemplateRoomsCoordinatorParameters
|
||||
|
||||
private var navigationRouter: NavigationRouterType {
|
||||
parameters.navigationRouter
|
||||
}
|
||||
|
||||
// MARK: Public
|
||||
|
||||
// Must be used only internally
|
||||
var childCoordinators: [Coordinator] = []
|
||||
|
||||
var callback: (() -> Void)?
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(parameters: TemplateRoomsCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
}
|
||||
|
||||
-8
@@ -21,22 +21,14 @@ struct TemplateRoomChatCoordinatorParameters {
|
||||
}
|
||||
|
||||
final class TemplateRoomChatCoordinator: Coordinator, Presentable {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private let parameters: TemplateRoomChatCoordinatorParameters
|
||||
private let templateRoomChatHostingController: UIViewController
|
||||
private var templateRoomChatViewModel: TemplateRoomChatViewModelProtocol
|
||||
|
||||
// MARK: Public
|
||||
|
||||
// Must be used only internally
|
||||
var childCoordinators: [Coordinator] = []
|
||||
var callback: (() -> Void)?
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(parameters: TemplateRoomChatCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
let viewModel = TemplateRoomChatViewModel(templateRoomChatService: TemplateRoomChatService(room: parameters.room))
|
||||
|
||||
-8
@@ -18,17 +18,11 @@ import Combine
|
||||
import Foundation
|
||||
|
||||
class TemplateRoomChatService: TemplateRoomChatServiceProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private let room: MXRoom
|
||||
private let eventFormatter: EventFormatter
|
||||
private var timeline: MXEventTimeline?
|
||||
private var eventBatch: [MXEvent]
|
||||
private var roomListenerReference: Any?
|
||||
|
||||
// MARK: Public
|
||||
|
||||
private(set) var chatMessagesSubject: CurrentValueSubject<[TemplateRoomChatMessage], Never>
|
||||
private(set) var roomInitializationStatus: CurrentValueSubject<TemplateRoomChatRoomInitializationStatus, Never>
|
||||
@@ -36,8 +30,6 @@ class TemplateRoomChatService: TemplateRoomChatServiceProtocol {
|
||||
var roomName: String? {
|
||||
room.summary.displayname
|
||||
}
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(room: MXRoom) {
|
||||
self.room = room
|
||||
|
||||
+1
-11
@@ -17,27 +17,17 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias TemplateRoomChatViewModelType = StateStoreViewModel<TemplateRoomChatViewState,
|
||||
Never,
|
||||
TemplateRoomChatViewAction>
|
||||
typealias TemplateRoomChatViewModelType = StateStoreViewModel<TemplateRoomChatViewState, Never, TemplateRoomChatViewAction>
|
||||
|
||||
class TemplateRoomChatViewModel: TemplateRoomChatViewModelType, TemplateRoomChatViewModelProtocol {
|
||||
enum Constants {
|
||||
static let maxTimeBeforeNewBubble: TimeInterval = 5 * 60
|
||||
}
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private let templateRoomChatService: TemplateRoomChatServiceProtocol
|
||||
|
||||
// MARK: Public
|
||||
|
||||
var callback: ((TemplateRoomChatViewModelAction) -> Void)?
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(templateRoomChatService: TemplateRoomChatServiceProtocol) {
|
||||
self.templateRoomChatService = templateRoomChatService
|
||||
super.init(initialViewState: Self.defaultState(templateRoomChatService: templateRoomChatService))
|
||||
|
||||
-6
@@ -18,14 +18,8 @@ import Combine
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateRoomChat: View {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@ObservedObject var viewModel: TemplateRoomChatViewModel.Context
|
||||
var presentedModally = false
|
||||
|
||||
|
||||
-6
@@ -17,14 +17,8 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateRoomChatBubbleContentView: View {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
// MARK: Public
|
||||
|
||||
let bubbleItem: TemplateRoomChatBubbleItem
|
||||
|
||||
var body: some View {
|
||||
|
||||
-6
@@ -17,14 +17,8 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateRoomChatBubbleImage: View {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
// MARK: Public
|
||||
|
||||
let imageContent: TemplateRoomChatMessageImageContent
|
||||
|
||||
var body: some View {
|
||||
|
||||
-6
@@ -17,14 +17,8 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateRoomChatBubbleMessage: View {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
// MARK: Public
|
||||
|
||||
let messageContent: TemplateRoomChatMessageTextContent
|
||||
|
||||
var body: some View {
|
||||
|
||||
-6
@@ -17,14 +17,8 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateRoomChatBubbleView: View {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
// MARK: Public
|
||||
|
||||
let bubble: TemplateRoomChatBubble
|
||||
|
||||
var body: some View {
|
||||
|
||||
-8
@@ -21,22 +21,14 @@ struct TemplateRoomListCoordinatorParameters {
|
||||
}
|
||||
|
||||
final class TemplateRoomListCoordinator: Coordinator, Presentable {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private let parameters: TemplateRoomListCoordinatorParameters
|
||||
private let templateRoomListHostingController: UIViewController
|
||||
private var templateRoomListViewModel: TemplateRoomListViewModelProtocol
|
||||
|
||||
// MARK: Public
|
||||
|
||||
// Must be used only internally
|
||||
var childCoordinators: [Coordinator] = []
|
||||
var callback: ((TemplateRoomListCoordinatorAction) -> Void)?
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(parameters: TemplateRoomListCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
let viewModel = TemplateRoomListViewModel(templateRoomListService: TemplateRoomListService(session: parameters.session))
|
||||
|
||||
-8
@@ -18,19 +18,11 @@ import Combine
|
||||
import Foundation
|
||||
|
||||
class TemplateRoomListService: TemplateRoomListServiceProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private let session: MXSession
|
||||
private var listenerReference: Any?
|
||||
|
||||
// MARK: Public
|
||||
|
||||
private(set) var roomsSubject: CurrentValueSubject<[TemplateRoomListRoom], Never>
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(session: MXSession) {
|
||||
self.session = session
|
||||
|
||||
|
||||
+1
-11
@@ -17,23 +17,13 @@
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
typealias TemplateRoomListViewModelType = StateStoreViewModel<TemplateRoomListViewState,
|
||||
Never,
|
||||
TemplateRoomListViewAction>
|
||||
typealias TemplateRoomListViewModelType = StateStoreViewModel<TemplateRoomListViewState, Never, TemplateRoomListViewAction>
|
||||
|
||||
class TemplateRoomListViewModel: TemplateRoomListViewModelType, TemplateRoomListViewModelProtocol {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private let templateRoomListService: TemplateRoomListServiceProtocol
|
||||
|
||||
// MARK: Public
|
||||
|
||||
var callback: ((TemplateRoomListViewModelAction) -> Void)?
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(templateRoomListService: TemplateRoomListServiceProtocol) {
|
||||
self.templateRoomListService = templateRoomListService
|
||||
super.init(initialViewState: Self.defaultState(templateRoomListService: templateRoomListService))
|
||||
|
||||
-6
@@ -17,14 +17,8 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateRoomList: View {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@ObservedObject var viewModel: TemplateRoomListViewModelType.Context
|
||||
|
||||
var body: some View {
|
||||
|
||||
-6
@@ -17,14 +17,8 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateRoomListRow: View {
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
// MARK: Public
|
||||
|
||||
let avatar: AvatarInputProtocol
|
||||
let displayName: String?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user