wip
This commit is contained in:
parent
5fc5457bf0
commit
32086a28e8
|
@ -10,6 +10,5 @@ enum AppAction: Codable {
|
|||
case rostersAction(_ action: RostersAction)
|
||||
case chatsAction(_ action: ChatsAction)
|
||||
case conversationAction(_ action: ConversationAction)
|
||||
case messagesAction(_ action: MessagesAction)
|
||||
case sharingAction(_ action: SharingAction)
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
enum MessagesAction: Codable {
|
||||
case dumb
|
||||
}
|
|
@ -6,6 +6,7 @@ enum SharingAction: Stateable {
|
|||
case shareLocation(lat: Double, lon: Double)
|
||||
case shareContact(jid: String)
|
||||
case shareDocuments([Data])
|
||||
case shareMedia(ids: [String])
|
||||
|
||||
case checkCameraAccess
|
||||
case setCameraAccess(Bool)
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
import Combine
|
||||
|
||||
final class MessagesMiddleware {
|
||||
static let shared = MessagesMiddleware()
|
||||
|
||||
func middleware(state _: AppState, action: AppAction) -> AnyPublisher<AppAction, Never> {
|
||||
switch action {
|
||||
default:
|
||||
return Empty().eraseToAnyPublisher()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,9 +28,6 @@ extension AppState {
|
|||
case .conversationAction(let action):
|
||||
ConversationState.reducer(state: &state.conversationsState, action: action)
|
||||
|
||||
case .messagesAction:
|
||||
break // messages actions are processed by MessagesMiddleware, and other components
|
||||
|
||||
case .sharingAction(let action):
|
||||
SharingState.reducer(state: &state.sharingState, action: action)
|
||||
}
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
import Foundation
|
||||
|
||||
final class CameraService {
|
||||
var dumb = false
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
import Foundation
|
||||
|
||||
final class GalleryService {
|
||||
var dumb = false
|
||||
}
|
|
@ -14,7 +14,6 @@ let store = AppStore(
|
|||
RostersMiddleware.shared.middleware,
|
||||
ChatsMiddleware.shared.middleware,
|
||||
ConversationMiddleware.shared.middleware,
|
||||
MessagesMiddleware.shared.middleware,
|
||||
SharingMiddleware.shared.middleware
|
||||
]
|
||||
)
|
||||
|
|
|
@ -125,8 +125,7 @@ struct AttachmentMediaPickerView: View {
|
|||
}
|
||||
.clipped()
|
||||
.onTapGesture {
|
||||
// let ids = selectedMedia.map { $0.id }
|
||||
// sendGalleryMedia(ids: ids)
|
||||
store.dispatch(.sharingAction(.shareMedia(ids: selectedItems)))
|
||||
store.dispatch(.sharingAction(.showSharing(false)))
|
||||
}
|
||||
}
|
||||
|
@ -190,9 +189,9 @@ private struct GridViewItem: View {
|
|||
.onTapGesture {
|
||||
isSelected.toggle()
|
||||
if isSelected {
|
||||
selected.removeAll { $0 == item.id }
|
||||
} else {
|
||||
selected.append(item.id)
|
||||
} else {
|
||||
selected.removeAll { $0 == item.id }
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue