another.im-ios/ConversationsClassic/AppCore/Reducers/ConversationReducer.swift

18 lines
439 B
Swift
Raw Normal View History

2024-06-26 06:51:56 +00:00
import SwiftUI
2024-06-21 10:32:16 +00:00
extension ConversationState {
static func reducer(state: inout ConversationState, action: ConversationAction) {
switch action {
2024-06-26 06:51:56 +00:00
case .makeConversationActive(let chat, let roster):
2024-06-21 10:42:50 +00:00
state.currentChat = chat
2024-06-26 06:51:56 +00:00
state.currentRoster = roster
2024-06-21 10:32:16 +00:00
2024-06-26 06:51:56 +00:00
case .messagesUpdated(let messages):
state.currentMessages = messages
2024-06-24 13:28:26 +00:00
2024-06-21 10:32:16 +00:00
default:
break
}
}
}