another.im-ios/ConversationsClassic/AppCore/Middlewares/FileMiddleware.swift

22 lines
565 B
Swift
Raw Normal View History

2024-07-11 13:59:24 +00:00
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()
}
}
}