mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Fix media selection undo
This commit is contained in:
@@ -1259,7 +1259,11 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
|
||||
if let undoOverlayController = strongSelf.undoOverlayController {
|
||||
undoOverlayController.content = .image(image: image ?? UIImage(), text: text)
|
||||
} else {
|
||||
let undoOverlayController = UndoOverlayController(presentationData: presentationData, content: .image(image: image ?? UIImage(), text: text), elevatedLayout: false, action: { [weak self] action in
|
||||
var elevatedLayout = true
|
||||
if let layout = strongSelf.validLayout, case .regular = layout.metrics.widthClass {
|
||||
elevatedLayout = false
|
||||
}
|
||||
let undoOverlayController = UndoOverlayController(presentationData: presentationData, content: .image(image: image ?? UIImage(), text: text), elevatedLayout: elevatedLayout, action: { [weak self] action in
|
||||
guard let strongSelf = self else {
|
||||
return true
|
||||
}
|
||||
@@ -1271,7 +1275,11 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
|
||||
}
|
||||
return true
|
||||
})
|
||||
strongSelf.present(undoOverlayController, in: .current)
|
||||
if let layout = strongSelf.validLayout, case .regular = layout.metrics.widthClass {
|
||||
strongSelf.present(undoOverlayController, in: .current)
|
||||
} else {
|
||||
strongSelf.present(undoOverlayController, in: .window(.root))
|
||||
}
|
||||
strongSelf.undoOverlayController = undoOverlayController
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user