Skip to content

Commit

Permalink
Download fix
Browse files Browse the repository at this point in the history
  • Loading branch information
z1tr0t3c committed Apr 24, 2021
1 parent 8596ba7 commit 4e622be
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 32 deletions.
4 changes: 2 additions & 2 deletions blista.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@
INFOPLIST_FILE = blista/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.20.0;
MARKETING_VERSION = 1.20.1;
PRODUCT_BUNDLE_IDENTIFIER = de.zitrotec.blista;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -619,7 +619,7 @@
INFOPLIST_FILE = blista/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.20.0;
MARKETING_VERSION = 1.20.1;
PRODUCT_BUNDLE_IDENTIFIER = de.zitrotec.blista;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
49 changes: 19 additions & 30 deletions blista/EighthViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,26 @@ class EighthViewController: UIViewController, UIWebViewDelegate {

func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
if navigationType == UIWebViewNavigationType.linkClicked {

if (request.url!.host == "katalog.blista.de") {
return true

if (request.url!.scheme == "mailto") {
if #available(iOS 10.0, *) {
UIApplication.shared.open(request.url!, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(request.url!)
}
return false
}

if (request.url!.scheme == "tel") {
if #available(iOS 10.0, *) {
UIApplication.shared.open(request.url!, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(request.url!)
}
return false
}

if (request.url!.pathExtension == "zip") || (request.url!.host == "blibu-katalog.blista.de") {

let userDefaults = UserDefaults.standard
let wifisetting = userDefaults.bool(forKey: "wifionly")
Expand All @@ -124,33 +140,6 @@ class EighthViewController: UIViewController, UIWebViewDelegate {

if reachability.connection == .cellular {

if (request.url!.host == "www.blista.de") {
if #available(iOS 10.0, *) {
UIApplication.shared.open(request.url!, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(request.url!)
}
return false
}

if (request.url!.scheme == "mailto") {
if #available(iOS 10.0, *) {
UIApplication.shared.open(request.url!, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(request.url!)
}
return false
}

if (request.url!.scheme == "tel") {
if #available(iOS 10.0, *) {
UIApplication.shared.open(request.url!, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(request.url!)
}
return false
}

if self.webView8.isLoading {
self.webView8.stopLoading()
}
Expand Down

0 comments on commit 4e622be

Please sign in to comment.