fix(ios): tweaks changes for Reachability update

This commit is contained in:
jahorton 2020-03-09 08:54:35 +07:00
parent 23af4e2497
commit f550617458
2 changed files with 2 additions and 2 deletions

View file

@ -31,7 +31,7 @@ open class Alerts {
public static func showDownloadErrorAlert(in vc: UIViewController, handler: @escaping AcceptanceHandler) {
var networkReachable: Reachability?
do {
try networkReachable = Reachability(hostname: "www.keyman.com")
try networkReachable = Reachability(hostname: "keyman.com")
} catch {
log.debug("reachability could not start")
}

View file

@ -144,7 +144,7 @@ class ResourceDownloadQueue: HTTPDownloadDelegate {
// Might should add a "withNotification: Bool" option for clarity.
public func canExecute(_ batch: DownloadBatch) -> Bool {
guard reachability?.connection != Reachability.Connection.unavailable else {
guard hasConnection() else {
let error = NSError(domain: "Keyman", code: 0,
userInfo: [NSLocalizedDescriptionKey: "No internet connection"])
downloadFailed(forBatch: batch, error: error)