Merge branch 'mkirk/video-select' into release/2.34.0
This commit is contained in:
commit
101d17cfeb
@ -317,10 +317,16 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat
|
||||
let attachmentPromises: [Promise<SignalAttachment>] = assets.map({
|
||||
return photoCollectionContents.outgoingAttachment(for: $0)
|
||||
})
|
||||
when(fulfilled: attachmentPromises)
|
||||
.map { attachments in
|
||||
|
||||
firstly {
|
||||
when(fulfilled: attachmentPromises)
|
||||
}.map { attachments in
|
||||
Logger.debug("built all attachments")
|
||||
self.didComplete(withAttachments: attachments)
|
||||
}.retainUntilComplete()
|
||||
}.catch { error in
|
||||
Logger.error("failed to prepare attachments. error: \(error)")
|
||||
OWSAlerts.showAlert(title: NSLocalizedString("IMAGE_PICKER_FAILED_TO_PROCESS_ATTACHMENTS", comment: "alert title"))
|
||||
}.retainUntilComplete()
|
||||
}
|
||||
|
||||
private func didComplete(withAttachments attachments: [SignalAttachment]) {
|
||||
|
||||
@ -142,7 +142,12 @@ class PhotoCollectionContents {
|
||||
|
||||
private func requestImageDataSource(for asset: PHAsset) -> Promise<(dataSource: DataSource, dataUTI: String)> {
|
||||
return Promise { resolver in
|
||||
_ = imageManager.requestImageData(for: asset, options: nil) { imageData, dataUTI, _, _ in
|
||||
|
||||
let options: PHImageRequestOptions = PHImageRequestOptions()
|
||||
options.isNetworkAccessAllowed = true
|
||||
|
||||
_ = imageManager.requestImageData(for: asset, options: options) { imageData, dataUTI, orientation, info in
|
||||
|
||||
guard let imageData = imageData else {
|
||||
resolver.reject(PhotoLibraryError.assertionError(description: "imageData was unexpectedly nil"))
|
||||
return
|
||||
@ -166,7 +171,10 @@ class PhotoCollectionContents {
|
||||
private func requestVideoDataSource(for asset: PHAsset) -> Promise<(dataSource: DataSource, dataUTI: String)> {
|
||||
return Promise { resolver in
|
||||
|
||||
_ = imageManager.requestExportSession(forVideo: asset, options: nil, exportPreset: AVAssetExportPresetMediumQuality) { exportSession, _ in
|
||||
let options: PHVideoRequestOptions = PHVideoRequestOptions()
|
||||
options.isNetworkAccessAllowed = true
|
||||
|
||||
_ = imageManager.requestExportSession(forVideo: asset, options: options, exportPreset: AVAssetExportPresetMediumQuality) { exportSession, foo in
|
||||
|
||||
guard let exportSession = exportSession else {
|
||||
resolver.reject(PhotoLibraryError.assertionError(description: "exportSession was unexpectedly nil"))
|
||||
|
||||
@ -1086,6 +1086,9 @@
|
||||
/* Label for crop button in image editor. */
|
||||
"IMAGE_EDITOR_CROP_BUTTON" = "Crop";
|
||||
|
||||
/* alert title */
|
||||
"IMAGE_PICKER_FAILED_TO_PROCESS_ATTACHMENTS" = "Failed to select attachment.";
|
||||
|
||||
/* Call setup status label */
|
||||
"IN_CALL_CONNECTING" = "Connecting…";
|
||||
|
||||
@ -2402,9 +2405,6 @@
|
||||
/* Title for the alert indicating that user should upgrade iOS. */
|
||||
"UPGRADE_IOS_ALERT_TITLE" = "Upgrade iOS";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Upgrading Signal ..." = "Upgrading Signal…";
|
||||
|
||||
/* button text for back button on verification view */
|
||||
"VERIFICATION_BACK_BUTTON" = "Back";
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user