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

21 lines
513 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 08:00:59 +00:00
case .messagesUpdated(let messages):
state.currentMessages = messages
2024-06-27 09:54:12 +00:00
case .setReplyText(let text):
state.replyText = text
2024-06-21 10:32:16 +00:00
default:
break
}
}
}