another.im-ios/ConversationsClassic/AppCore/State/AppState.swift
2024-08-07 10:36:33 +02:00

41 lines
901 B
Swift

import Foundation
enum AppFlow: Codable {
case start
case accounts
case chats
case contacts
case settings
case conversation
case createConversation
}
struct AppState: Stateable {
var appVersion: String
var previousFlow: AppFlow
var currentFlow: AppFlow
var startState: StartState
var accountsState: AccountsState
var rostersState: RostersState
var chatsState: ChatsState
var conversationsState: ConversationState
var sharingState: SharingState
}
// MARK: Init
extension AppState {
init() {
appVersion = Const.appVersion
previousFlow = .start
currentFlow = .start
startState = StartState()
accountsState = AccountsState()
rostersState = RostersState()
chatsState = ChatsState()
conversationsState = ConversationState()
sharingState = SharingState()
}
}