another.im-ios/ConversationsClassic/AppCore/Reducers/ConversationReducer.swift
2024-06-25 14:20:20 +02:00

16 lines
448 B
Swift

// TODO: implement complex merging list of messages
extension ConversationState {
static func reducer(state: inout ConversationState, action: ConversationAction) {
switch action {
case .makeConversationActive(let chat):
state.currentChat = chat
case .messageForCurrentConversationReceived(let message):
state.currentMessages.append(message)
default:
break
}
}
}