Skip to content

Instantly share code, notes, and snippets.

@thebnich
Created August 27, 2015 02:57
Show Gist options
  • Save thebnich/b8f7648bdf835c96e48b to your computer and use it in GitHub Desktop.
Save thebnich/b8f7648bdf835c96e48b to your computer and use it in GitHub Desktop.
diff --git a/Client/Frontend/Browser/Browser.swift b/Client/Frontend/Browser/Browser.swift
index a657460..2704656 100644
--- a/Client/Frontend/Browser/Browser.swift
+++ b/Client/Frontend/Browser/Browser.swift
@@ -41,7 +41,6 @@ class Browser: NSObject {
private(set) var screenshot: UIImage?
var screenshotUUID: NSUUID?
var showDialog = false
- var disableDialog = false
private var helperManager: HelperManager? = nil
private var configuration: WKWebViewConfiguration? = nil
diff --git a/Client/Frontend/Browser/BrowserViewController.swift b/Client/Frontend/Browser/BrowserViewController.swift
index 769b03b..f8cd602 100644
--- a/Client/Frontend/Browser/BrowserViewController.swift
+++ b/Client/Frontend/Browser/BrowserViewController.swift
@@ -1351,7 +1351,7 @@ extension BrowserViewController: WKNavigationDelegate {
urlBar.updateReaderModeState(ReaderModeState.Unavailable)
hideReaderModeBar(animated: false)
}
- tabManager.selectedTab?.disableDialog = false
+
tabManager.selectedTab?.showDialog = false
}
}
@@ -1526,7 +1526,7 @@ extension BrowserViewController: WKUIDelegate {
}
func disableDialog(switchState: UISwitch) {
- tabManager.selectedTab?.disableDialog = switchState.on
+ tabManager.selectedTab?.showDialog = !switchState.on
}
func removeDelegate() {
@@ -1547,7 +1547,7 @@ extension BrowserViewController: WKUIDelegate {
let alertController = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.Alert)
alertController.addAction(UIAlertAction(title: OKString, style: UIAlertActionStyle.Default, handler: { _ in
completionHandler()
- if tab.disableDialog {
+ if !tab.showDialog {
webView.UIDelegate = nil
}
}))
@@ -1579,7 +1579,7 @@ extension BrowserViewController: WKUIDelegate {
}))
alertController.addAction(UIAlertAction(title: CancelString, style: UIAlertActionStyle.Cancel, handler: { _ in
completionHandler(false)
- if tab.disableDialog {
+ if !tab.showDialog {
webView.UIDelegate = nil
}
}))
@@ -1616,7 +1616,7 @@ extension BrowserViewController: WKUIDelegate {
}))
alertController.addAction(UIAlertAction(title: CancelString, style: UIAlertActionStyle.Cancel, handler: { _ in
completionHandler(nil)
- if tab.disableDialog {
+ if !tab.showDialog {
webView.UIDelegate = nil
}
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment