Verified Commit 0d94ce89 authored by Eyad Hasan's avatar Eyad Hasan
Browse files

Finialized changes for the no-network-alert. Will be adding a issue to switch...

Finialized changes for the no-network-alert.  Will be adding a issue to switch our network checks to simply switch a boolean var to true or false, depending if we have a successful network connection
parent bf7e8169
......@@ -356,13 +356,15 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
formatter.timeZone = TimeZone(identifier: "America/New_York")
let now = Date()
let alertFilers = defaults.dictionary(forKey: "alerts") as! [String: Bool]?
// Probably a better way to do the check for network results, but it really doesn't matter so this will do for now.
var noNetwork = Reachability.isConnectedToNetwork()
let noNetworkAlert = Alert()
noNetworkAlert.noNetwork()
if !noNetwork {
shown.append(noNetworkAlert)
}
for alert in alertsList {
if now.isGreaterThanDate(dateToCompare: formatter.date(from: alert.startDate)!) && now.isLessThanDate(dateToCompare: formatter.date(from: alert.endDate)!) {
switch alert.urgency {
......@@ -608,7 +610,7 @@ class FacilitiesListViewController: UIViewController, UICollectionViewDelegate,
self.alertsList = model.alerts
}
else {
self.alertsList = List<Alert>()
self.alertsList = List<Alert>()
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment