mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
set gallery limit to 60 when the gallery ff is on
This commit is contained in:
@@ -20,9 +20,21 @@ enum MediaPickerScreenSource: Hashable {
|
||||
case documents(types: [UTType] = [.data])
|
||||
}
|
||||
|
||||
enum MediaPickerScreenSelectionType {
|
||||
enum MediaPickerScreenSelectionType: Hashable {
|
||||
case single
|
||||
case multiple
|
||||
/// Multiple items, up to the given limit.
|
||||
case multiple(limit: Int)
|
||||
|
||||
/// The number of attachments a gallery may contain, as recommended by
|
||||
/// [MSC4274](https://github.com/matrix-org/matrix-spec-proposals/pull/4274).
|
||||
static let galleryLimit = 60
|
||||
/// The number of items to allow when each is sent as an individual message.
|
||||
static let individualUploadLimit = 10
|
||||
|
||||
/// Multiple items, capped for a gallery when they're sent as one, or for individual uploads when not.
|
||||
static func multiple(galleryEnabled: Bool) -> Self {
|
||||
.multiple(limit: galleryEnabled ? galleryLimit : individualUploadLimit)
|
||||
}
|
||||
}
|
||||
|
||||
enum MediaPickerScreenCoordinatorAction {
|
||||
|
||||
@@ -39,8 +39,8 @@ struct PhotoLibraryPicker: UIViewControllerRepresentable {
|
||||
configuration.selectionLimit = switch selectionType {
|
||||
case .single:
|
||||
1
|
||||
case .multiple:
|
||||
10
|
||||
case .multiple(let limit):
|
||||
limit
|
||||
}
|
||||
|
||||
let pickerViewController = PHPickerViewController(configuration: configuration)
|
||||
|
||||
Reference in New Issue
Block a user