2024-06-19 15:15:27 +00:00
|
|
|
import Foundation
|
|
|
|
|
|
|
|
extension AppState {
|
|
|
|
static func reducer(state: inout AppState, action: AppAction) {
|
|
|
|
switch action {
|
|
|
|
case .flushState:
|
|
|
|
state = AppState()
|
|
|
|
|
|
|
|
case .changeFlow(let flow):
|
|
|
|
state.previousFlow = state.currentFlow
|
|
|
|
state.currentFlow = flow
|
|
|
|
|
|
|
|
case .startAction(let action):
|
|
|
|
StartState.reducer(state: &state.startState, action: action)
|
|
|
|
|
2024-07-23 09:58:26 +00:00
|
|
|
case .databaseAction, .xmppAction, .fileAction, .info, .messagesAction:
|
2024-07-12 11:43:14 +00:00
|
|
|
break // this actions are processed by other middlewares
|
2024-06-19 15:15:27 +00:00
|
|
|
|
|
|
|
case .accountsAction(let action):
|
|
|
|
AccountsState.reducer(state: &state.accountsState, action: action)
|
|
|
|
|
|
|
|
case .rostersAction(let action):
|
|
|
|
RostersState.reducer(state: &state.rostersState, action: action)
|
|
|
|
|
|
|
|
case .chatsAction(let action):
|
|
|
|
ChatsState.reducer(state: &state.chatsState, action: action)
|
2024-06-21 10:32:16 +00:00
|
|
|
|
|
|
|
case .conversationAction(let action):
|
|
|
|
ConversationState.reducer(state: &state.conversationsState, action: action)
|
2024-06-24 10:44:55 +00:00
|
|
|
|
2024-07-10 14:13:47 +00:00
|
|
|
case .sharingAction(let action):
|
|
|
|
SharingState.reducer(state: &state.sharingState, action: action)
|
2024-06-19 15:15:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|