From cb79211592deae585a722bd1995e97708e68d29e Mon Sep 17 00:00:00 2001 From: Ben Ulmer Date: Tue, 18 Jun 2019 14:35:40 -0700 Subject: [PATCH] done --- .../InAppBrowserWebViewController.swift | 36 ++++++++----------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/ios/Classes/InAppBrowserWebViewController.swift b/ios/Classes/InAppBrowserWebViewController.swift index a9f18726..fa57355a 100644 --- a/ios/Classes/InAppBrowserWebViewController.swift +++ b/ios/Classes/InAppBrowserWebViewController.swift @@ -272,27 +272,21 @@ class InAppBrowserWebViewController: UIViewController, UIScrollViewDelegate, WKU weak var weakSelf = self - // Run later to avoid the "took a long time" log message. - DispatchQueue.main.async(execute: {() -> Void in - if (weakSelf?.responds(to: #selector(getter: self.presentingViewController)))! { - weakSelf?.presentingViewController?.dismiss(animated: true, completion: {() -> Void in - self.tmpWindow?.windowLevel = 0.0 - UIApplication.shared.delegate?.window??.makeKeyAndVisible() - if (self.navigationDelegate != nil) { - self.navigationDelegate?.browserExit(uuid: self.uuid) - } - }) - } - else { - weakSelf?.parent?.dismiss(animated: true, completion: {() -> Void in - self.tmpWindow?.windowLevel = 0.0 - UIApplication.shared.delegate?.window??.makeKeyAndVisible() - if (self.navigationDelegate != nil) { - self.navigationDelegate?.browserExit(uuid: self.uuid) - } - }) - } - }) + if (weakSelf?.responds(to: #selector(getter: self.presentingViewController)))! { + weakSelf?.presentingViewController?.dismiss(animated: true, completion: {() -> Void in + self.tmpWindow?.windowLevel = 0.0 + UIApplication.shared.delegate?.window??.makeKeyAndVisible() + }) + } + else { + weakSelf?.parent?.dismiss(animated: true, completion: {() -> Void in + self.tmpWindow?.windowLevel = 0.0 + UIApplication.shared.delegate?.window??.makeKeyAndVisible() + }) + } + if (self.navigationDelegate != nil) { + self.navigationDelegate?.browserExit(uuid: self.uuid) + } } @objc func goBack() {