22 lines
565 B
Swift
22 lines
565 B
Swift
|
|
||
|
import Combine
|
||
|
|
||
|
final class FileMiddleware {
|
||
|
static let shared = AccountsMiddleware()
|
||
|
|
||
|
func middleware(state _: AppState, action: AppAction) -> AnyPublisher<AppAction, Never> {
|
||
|
switch action {
|
||
|
case .conversationAction(.messagesUpdated(let messages)):
|
||
|
for msg in messages {
|
||
|
if msg.attachment != nil {
|
||
|
print("Attachment found")
|
||
|
}
|
||
|
}
|
||
|
return Empty().eraseToAnyPublisher()
|
||
|
|
||
|
default:
|
||
|
return Empty().eraseToAnyPublisher()
|
||
|
}
|
||
|
}
|
||
|
}
|