mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Fix media selection undo
This commit is contained in:
parent
dcdb3a44a7
commit
689a5e0427
1 changed files with 10 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue