Change media saving option strings

This commit is contained in:
Ilya Laktyushin
2021-08-11 19:06:20 +03:00
parent 436ebb4be4
commit 6907ac9150
5 changed files with 12 additions and 7 deletions

View File

@@ -387,20 +387,22 @@ public final class ShareController: ViewController {
break
case let .image(representations):
if case .saveToCameraRoll = preferredAction {
self.defaultAction = ShareControllerAction(title: self.presentationData.strings.Preview_SaveToCameraRoll, action: { [weak self] in
self.defaultAction = ShareControllerAction(title: self.presentationData.strings.Gallery_SaveImage, action: { [weak self] in
self?.saveToCameraRoll(representations: representations)
self?.actionCompleted?()
})
}
case let .media(mediaReference):
var canSave = false
var isVideo = false
if mediaReference.media is TelegramMediaImage {
canSave = true
} else if mediaReference.media is TelegramMediaFile {
} else if let file = mediaReference.media as? TelegramMediaFile {
canSave = true
isVideo = file.isVideo
}
if case .saveToCameraRoll = preferredAction, canSave {
self.defaultAction = ShareControllerAction(title: self.presentationData.strings.Preview_SaveToCameraRoll, action: { [weak self] in
self.defaultAction = ShareControllerAction(title: isVideo ? self.presentationData.strings.Gallery_SaveVideo : self.presentationData.strings.Gallery_SaveImage, action: { [weak self] in
self?.saveToCameraRoll(mediaReference: mediaReference)
self?.actionCompleted?()
})