diff --git a/submodules/Display/Source/Navigation/NavigationModalContainer.swift b/submodules/Display/Source/Navigation/NavigationModalContainer.swift index 5ead1f9391..b7c486c8d5 100644 --- a/submodules/Display/Source/Navigation/NavigationModalContainer.swift +++ b/submodules/Display/Source/Navigation/NavigationModalContainer.swift @@ -282,7 +282,7 @@ final class NavigationModalContainer: ASDisplayNode, ASScrollViewDelegate, ASGes let transition: ContainedViewLayoutTransition let dismissProgress: CGFloat if (velocity.y < -0.5 || progress >= 0.5) && self.checkInteractiveDismissWithControllers() { - if self.isDraggingHeader, let controller = self.container.controllers.last as? MinimizableController { + if let controller = self.container.controllers.last as? MinimizableController, self.isDraggingHeader || "".isEmpty { dismissProgress = 0.0 targetOffset = 0.0 transition = .immediate diff --git a/submodules/TelegramUI/Components/Stars/StarsTransactionsScreen/Sources/StarsTransactionsScreen.swift b/submodules/TelegramUI/Components/Stars/StarsTransactionsScreen/Sources/StarsTransactionsScreen.swift index f7ebfb81c6..638f2d3f57 100644 --- a/submodules/TelegramUI/Components/Stars/StarsTransactionsScreen/Sources/StarsTransactionsScreen.swift +++ b/submodules/TelegramUI/Components/Stars/StarsTransactionsScreen/Sources/StarsTransactionsScreen.swift @@ -815,12 +815,14 @@ public final class StarsTransactionsScreen: ViewControllerComponentContainer { let presentationData = context.sharedContext.currentPresentationData.with { $0 } let resultController = UndoOverlayController( presentationData: presentationData, - content: .image( - image: UIImage(bundleImageName: "Premium/Stars/StarLarge")!, - title: presentationData.strings.Stars_Intro_PurchasedTitle, + content: .universal( + animation: "StarsBuy", + scale: 0.066, + colors: [:], + title: presentationData.strings.Stars_Intro_PurchasedTitle, text: presentationData.strings.Stars_Intro_PurchasedText(presentationData.strings.Stars_Intro_PurchasedText_Stars(Int32(stars))).string, - round: false, - undoText: nil + customUndoText: nil, + timeout: nil ), elevatedLayout: false, action: { _ in return true}) @@ -850,8 +852,42 @@ public final class StarsTransactionsScreen: ViewControllerComponentContainer { starsContext: starsContext, options: options, purpose: .gift(peerId: peerId), - completion: { stars in - + completion: { [weak self] stars in + guard let self else { + return + } + + Queue.mainQueue().after(2.0) { + //TODO:localize + let presentationData = context.sharedContext.currentPresentationData.with { $0 } + let resultController = UndoOverlayController( + presentationData: presentationData, + content: .universal( + animation: "StarsSend", + scale: 0.066, + colors: [:], + title: nil, + text: "\(stars) Stars sent.", + customUndoText: "View Chat", + timeout: nil + ), + elevatedLayout: false, + action: { [weak self] action in + if case .undo = action, let navigationController = self?.navigationController as? NavigationController { + let _ = (context.engine.data.get( + TelegramEngine.EngineData.Item.Peer.Peer(id: peerId) + ) + |> deliverOnMainQueue).start(next: { peer in + guard let peer else { + return + } + context.sharedContext.navigateToChatController(NavigateToChatControllerParams(navigationController: navigationController, chatController: nil, context: context, chatLocation: .peer(peer), subject: nil, botStart: nil, updateTextInputState: nil, keepStack: .always, useExisting: true, purposefulAction: nil, scrollToEndIfExists: false, activateMessageSearch: nil, animated: true)) + }) + } + return true + }) + self.present(resultController, in: .window(.root)) + } } ) self.push(purchaseController) diff --git a/submodules/TelegramUI/Components/Stars/StarsTransferScreen/Sources/StarsTransferScreen.swift b/submodules/TelegramUI/Components/Stars/StarsTransferScreen/Sources/StarsTransferScreen.swift index 71b0c643d1..84cdd6589f 100644 --- a/submodules/TelegramUI/Components/Stars/StarsTransferScreen/Sources/StarsTransferScreen.swift +++ b/submodules/TelegramUI/Components/Stars/StarsTransferScreen/Sources/StarsTransferScreen.swift @@ -518,12 +518,21 @@ private final class SheetContent: CombinedComponent { if let lastController = navigationController.viewControllers.last as? ViewController { let resultController = UndoOverlayController( presentationData: presentationData, - content: .image( - image: UIImage(bundleImageName: "Premium/Stars/StarLarge")!, +// content: .image( +// image: UIImage(bundleImageName: "Premium/Stars/StarLarge")!, +// title: presentationData.strings.Stars_Transfer_PurchasedTitle, +// text: text, +// round: false, +// undoText: nil +// ), + content: .universal( + animation: "StarsSend", + scale: 0.066, + colors: [:], title: presentationData.strings.Stars_Transfer_PurchasedTitle, text: text, - round: false, - undoText: nil + customUndoText: nil, + timeout: nil ), elevatedLayout: lastController is ChatController, action: { _ in return true} diff --git a/submodules/TelegramUI/Resources/Animations/StarsBuy.tgs b/submodules/TelegramUI/Resources/Animations/StarsBuy.tgs new file mode 100644 index 0000000000..e684dd1aa7 Binary files /dev/null and b/submodules/TelegramUI/Resources/Animations/StarsBuy.tgs differ diff --git a/submodules/TelegramUI/Resources/Animations/StarsSend.tgs b/submodules/TelegramUI/Resources/Animations/StarsSend.tgs new file mode 100644 index 0000000000..3d4e32a67e Binary files /dev/null and b/submodules/TelegramUI/Resources/Animations/StarsSend.tgs differ