mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Fix web app QR scanner dismissal
This commit is contained in:
parent
fe904af993
commit
2ee21cc5e1
@ -828,7 +828,11 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
let controller = QrCodeScanScreen(context: self.context, subject: .custom(info: info))
|
||||
controller.completion = { [weak self] result in
|
||||
if let strongSelf = self {
|
||||
strongSelf.sendQrCodeScannedEvent(data: result)
|
||||
if let result = result {
|
||||
strongSelf.sendQrCodeScannedEvent(data: result)
|
||||
} else {
|
||||
strongSelf.sendQrCodeScannerClosedEvent()
|
||||
}
|
||||
}
|
||||
}
|
||||
self.currentQrCodeScannerScreen = controller
|
||||
@ -983,7 +987,7 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
self.webView?.sendEvent(name: "qr_text_received", data: paramsString)
|
||||
}
|
||||
|
||||
fileprivate func sendQrCodeScannerClosedEvent(data: String?) {
|
||||
fileprivate func sendQrCodeScannerClosedEvent() {
|
||||
self.webView?.sendEvent(name: "scan_qr_popup_closed", data: nil)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user