conversations-classic-ios/ConversationsClassic/AppCore/Reducers/SharingReducer.swift
2024-07-16 13:48:50 +02:00

31 lines
862 B
Swift

import Foundation
extension SharingState {
static func reducer(state: inout SharingState, action: SharingAction) {
switch action {
case .showSharing(let shown):
state.sharingShown = shown
case .setCameraAccess(let granted):
state.isCameraAccessGranted = granted
case .setGalleryAccess(let granted):
state.isGalleryAccessGranted = granted
// case .cameraCaptured(let media, let type):
// state.cameraCapturedMedia = media
// state.cameraCapturedMediaType = type
//
// case .flushCameraCaptured:
// state.cameraCapturedMedia = Data()
// state.cameraCapturedMediaType = .photo
case .galleryItemsUpdated(let items):
state.galleryItems = items
default:
break
}
}
}