mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Group boosts
This commit is contained in:
@@ -291,6 +291,8 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
|
||||
private var paymentDisposable: Disposable?
|
||||
|
||||
private var lastExpansionTimestamp: Double?
|
||||
|
||||
private var didTransitionIn = false
|
||||
private var dismissed = false
|
||||
|
||||
@@ -739,7 +741,7 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
guard let eventName = body["eventName"] as? String else {
|
||||
return
|
||||
}
|
||||
|
||||
let currentTimestamp = CACurrentMediaTime()
|
||||
let eventData = (body["eventData"] as? String)?.data(using: .utf8)
|
||||
let json = try? JSONSerialization.jsonObject(with: eventData ?? Data(), options: []) as? [String: Any]
|
||||
|
||||
@@ -804,7 +806,12 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
case "web_app_request_theme":
|
||||
self.sendThemeChangedEvent()
|
||||
case "web_app_expand":
|
||||
controller.requestAttachmentMenuExpansion()
|
||||
if let lastExpansionTimestamp = self.lastExpansionTimestamp, currentTimestamp < lastExpansionTimestamp + 1.0 {
|
||||
|
||||
} else {
|
||||
self.lastExpansionTimestamp = currentTimestamp
|
||||
controller.requestAttachmentMenuExpansion()
|
||||
}
|
||||
case "web_app_close":
|
||||
controller.dismiss()
|
||||
case "web_app_open_tg_link":
|
||||
@@ -846,7 +853,6 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
case "web_app_open_link":
|
||||
if let json = json, let url = json["url"] as? String {
|
||||
let tryInstantView = json["try_instant_view"] as? Bool ?? false
|
||||
let currentTimestamp = CACurrentMediaTime()
|
||||
if let lastTouchTimestamp = self.webView?.lastTouchTimestamp, currentTimestamp < lastTouchTimestamp + 10.0 {
|
||||
self.webView?.lastTouchTimestamp = nil
|
||||
if tryInstantView {
|
||||
|
||||
Reference in New Issue
Block a user