mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Various fixes
This commit is contained in:
@@ -1013,7 +1013,7 @@ public func createGiveawayController(context: AccountContext, updatedPresentatio
|
||||
let controller = ItemListController(context: context, state: signal)
|
||||
controller.navigationPresentation = .modal
|
||||
controller.beganInteractiveDragging = {
|
||||
dismissInputImpl?()
|
||||
// dismissInputImpl?()
|
||||
}
|
||||
presentControllerImpl = { [weak controller] c in
|
||||
controller?.present(c, in: .window(.root))
|
||||
|
||||
@@ -45,7 +45,7 @@ extension MediaEditorScreen {
|
||||
}
|
||||
|
||||
func saveDraft(id: Int64?) {
|
||||
guard let subject = self.node.subject, let mediaEditor = self.node.mediaEditor else {
|
||||
guard let subject = self.node.subject, let actualSubject = self.node.actualSubject, let mediaEditor = self.node.mediaEditor else {
|
||||
return
|
||||
}
|
||||
try? FileManager.default.createDirectory(atPath: draftPath(engine: self.context.engine), withIntermediateDirectories: true)
|
||||
@@ -60,7 +60,7 @@ extension MediaEditorScreen {
|
||||
var timestamp: Int32
|
||||
var location: CLLocationCoordinate2D?
|
||||
let expiresOn: Int32
|
||||
if case let .draft(draft, _) = subject {
|
||||
if case let .draft(draft, _) = actualSubject {
|
||||
timestamp = draft.timestamp
|
||||
location = draft.location
|
||||
if let _ = id {
|
||||
@@ -189,12 +189,15 @@ extension MediaEditorScreen {
|
||||
} else if let image = UIImage(contentsOfFile: draft.fullPath(engine: context.engine)) {
|
||||
innerSaveDraft(media: .image(image: image, dimensions: draft.dimensions))
|
||||
}
|
||||
removeStoryDraft(engine: self.context.engine, path: draft.path, delete: false)
|
||||
case .message:
|
||||
if let pixel = generateSingleColorImage(size: CGSize(width: 1, height: 1), color: .black) {
|
||||
innerSaveDraft(media: .image(image: pixel, dimensions: PixelDimensions(width: 1080, height: 1920)))
|
||||
}
|
||||
}
|
||||
|
||||
if case let .draft(draft, _) = actualSubject {
|
||||
removeStoryDraft(engine: self.context.engine, path: draft.path, delete: false)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3010,7 +3010,7 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
|
||||
self.backgroundDimView.layer.animateAlpha(from: previousDimAlpha, to: 0.0, duration: 0.15)
|
||||
|
||||
var isNew: Bool? = false
|
||||
if let subject = self.subject {
|
||||
if let subject = self.actualSubject {
|
||||
if saveDraft {
|
||||
isNew = true
|
||||
}
|
||||
@@ -3397,7 +3397,7 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
|
||||
}
|
||||
|
||||
var location: CLLocationCoordinate2D?
|
||||
if let subject = self.subject {
|
||||
if let subject = self.actualSubject {
|
||||
if case let .asset(asset) = subject {
|
||||
location = asset.location?.coordinate
|
||||
} else if case let .draft(draft, _) = subject {
|
||||
@@ -4933,7 +4933,7 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
|
||||
if saveDraft {
|
||||
self.saveDraft(id: nil)
|
||||
} else {
|
||||
if case let .draft(draft, id) = self.node.subject, id == nil {
|
||||
if case let .draft(draft, id) = self.node.actualSubject, id == nil {
|
||||
removeStoryDraft(engine: self.context.engine, path: draft.path, delete: true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user