Bladeren bron

Added:
Allow only Dex share and no NS Url

Jon Fawcett 6 jaren geleden
bovenliggende
commit
ee65e619a7

+ 1 - 1
LoopFollow/ViewControllers/MainViewController.swift

@@ -175,7 +175,7 @@ class MainViewController: UIViewController, UITableViewDataSource, ChartViewDele
         }
         
         // Load Data
-        if UserDefaultsRepository.url.value != "" && firstGraphLoad {
+        if (UserDefaultsRepository.url.value != "" || (UserDefaultsRepository.shareUserName.value != "" && UserDefaultsRepository.sharePassword.value != "")) && firstGraphLoad {
             nightscoutLoader()
         }
     }

+ 3 - 1
LoopFollow/ViewControllers/SettingsViewController.swift

@@ -36,7 +36,9 @@ class SettingsViewController: FormViewController {
         }.cellSetup { (cell, row) in
             cell.textField.autocorrectionType = .no
         }.onChange { row in
-            guard let value = row.value else { return }
+            guard let value = row.value else {
+                UserDefaultsRepository.url.value = ""
+                return }
             // check the format of the URL entered by the user and trim away any spaces or "/" at the end
             var urlNSInput = value.replacingOccurrences(of: "\\s+$", with: "", options: .regularExpression)
             if urlNSInput.last == "/" {