This commit is contained in:
Ilya Laktyushin 2025-02-22 21:35:07 +04:00
parent 85b7ecac14
commit 1a89986990

View File

@ -17,6 +17,7 @@ import TelegramNotices
extension ChatControllerImpl { extension ChatControllerImpl {
func presentPaidMessageAlertIfNeeded(count: Int32 = 1, forceDark: Bool = false, completion: @escaping (Bool) -> Void) { func presentPaidMessageAlertIfNeeded(count: Int32 = 1, forceDark: Bool = false, completion: @escaping (Bool) -> Void) {
guard let peer = self.presentationInterfaceState.renderedPeer?.peer.flatMap(EnginePeer.init) else { guard let peer = self.presentationInterfaceState.renderedPeer?.peer.flatMap(EnginePeer.init) else {
completion(false)
return return
} }
if let sendPaidMessageStars = self.presentationInterfaceState.sendPaidMessageStars { if let sendPaidMessageStars = self.presentationInterfaceState.sendPaidMessageStars {
@ -71,6 +72,8 @@ extension ChatControllerImpl {
self.present(controller, in: .window(.root)) self.present(controller, in: .window(.root))
} }
}) })
} else {
completion(false)
} }
} }