From 0137836f511b0da0f2fccb281c8af9ba4720ecf7 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Tue, 28 May 2024 13:31:58 +0400 Subject: [PATCH] Various improvements --- .../Sources/StarsTransferScreen.swift | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/submodules/TelegramUI/Components/Stars/StarsTransferScreen/Sources/StarsTransferScreen.swift b/submodules/TelegramUI/Components/Stars/StarsTransferScreen/Sources/StarsTransferScreen.swift index ec1fb878f26..3d45440c82e 100644 --- a/submodules/TelegramUI/Components/Stars/StarsTransferScreen/Sources/StarsTransferScreen.swift +++ b/submodules/TelegramUI/Components/Stars/StarsTransferScreen/Sources/StarsTransferScreen.swift @@ -414,19 +414,26 @@ private final class SheetContent: CombinedComponent { } }, completion: { [weak controller] in let presentationData = accountContext.sharedContext.currentPresentationData.with { $0 } - let resultController = UndoOverlayController( - presentationData: presentationData, - content: .image( - image: UIImage(bundleImageName: "Premium/Stars/StarLarge")!, - title: presentationData.strings.Stars_Transfer_PurchasedTitle, - text: presentationData.strings.Stars_Transfer_PurchasedText(invoice.title, botTitle, presentationData.strings.Stars_Transfer_Purchased_Stars(Int32(invoice.totalAmount))).string, - round: false, - undoText: nil - ), - elevatedLayout: true, - action: { _ in return true}) - controller?.present(resultController, in: .window(.root)) - + if let navigationController = controller?.navigationController { + Queue.mainQueue().after(0.5) { + if let lastController = navigationController.viewControllers.last as? ViewController { + let resultController = UndoOverlayController( + presentationData: presentationData, + content: .image( + image: UIImage(bundleImageName: "Premium/Stars/StarLarge")!, + title: presentationData.strings.Stars_Transfer_PurchasedTitle, + text: presentationData.strings.Stars_Transfer_PurchasedText(invoice.title, botTitle, presentationData.strings.Stars_Transfer_Purchased_Stars(Int32(invoice.totalAmount))).string, + round: false, + undoText: nil + ), + elevatedLayout: lastController is ChatController, + action: { _ in return true} + ) + lastController.present(resultController, in: .window(.root)) + } + } + } + controller?.complete(paid: true) controller?.dismissAnimated()