Various fixes

This commit is contained in:
Ilya Laktyushin
2022-04-04 02:16:32 +04:00
parent c0377584ae
commit fd88343573
14 changed files with 43 additions and 34 deletions

View File

@@ -282,7 +282,9 @@ public final class WebAppController: ViewController, AttachmentContainable {
self.handleSendData(data: eventData)
}
case "web_app_setup_main_button":
if let eventData = (body["eventData"] as? String)?.data(using: .utf8), let json = try? JSONSerialization.jsonObject(with: eventData, options: []) as? [String: Any] {
if let webView = self.webView, !webView.didTouchOnce {
} else if let eventData = (body["eventData"] as? String)?.data(using: .utf8), let json = try? JSONSerialization.jsonObject(with: eventData, options: []) as? [String: Any] {
if let isVisible = json["is_visible"] as? Bool {
let text = json["text"] as? String
let backgroundColorString = json["color"] as? String