2024-06-19 15:15:27 +00:00
|
|
|
extension ChatsState {
|
|
|
|
static func reducer(state: inout ChatsState, action: ChatsAction) {
|
|
|
|
switch action {
|
|
|
|
case .chatsListUpdated(let chats):
|
|
|
|
state.chats = chats
|
|
|
|
|
2024-06-20 05:43:49 +00:00
|
|
|
case .chatStarted(let chat):
|
|
|
|
state.currentChat = chat
|
|
|
|
|
2024-06-19 15:15:27 +00:00
|
|
|
default:
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|