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