فهرست منبع

Refreshing buggfix

Jonas Björkert 1 سال پیش
والد
کامیت
3cce5b7992

+ 2 - 2
LoopFollow/Controllers/Nightscout/BGData.swift

@@ -210,9 +210,9 @@ extension MainViewController {
     
     
     // NS BG Data Front end updater
     // NS BG Data Front end updater
     func viewUpdateNSBG(sourceName: String) {
     func viewUpdateNSBG(sourceName: String) {
-        TaskScheduler.shared.rescheduleTask(id: .minAgoUpdate, to: Date())
-        
         DispatchQueue.main.async {
         DispatchQueue.main.async {
+            TaskScheduler.shared.rescheduleTask(id: .minAgoUpdate, to: Date())
+
             let entries = self.bgData
             let entries = self.bgData
             if entries.count < 2 { return } // Protect index out of bounds
             if entries.count < 2 { return } // Protect index out of bounds
             
             

+ 0 - 1
LoopFollow/Log/LogViewModel.swift

@@ -26,7 +26,6 @@ class LogViewModel: ObservableObject {
 
 
         loadLogEntries()
         loadLogEntries()
 
 
-        // Optional: Set up a timer to refresh logs periodically
         Timer.publish(every: 5.0, on: .main, in: .common)
         Timer.publish(every: 5.0, on: .main, in: .common)
             .autoconnect()
             .autoconnect()
             .sink { [weak self] _ in
             .sink { [weak self] _ in

+ 1 - 0
LoopFollow/ViewControllers/MainViewController.swift

@@ -263,6 +263,7 @@ class MainViewController: UIViewController, UITableViewDataSource, ChartViewDele
         }
         }
 
 
         MinAgoText.text = "Refreshing"
         MinAgoText.text = "Refreshing"
+        latestMinAgoString = "Refreshing"
         scheduleAllTasks()
         scheduleAllTasks()
 
 
         currentCage = nil
         currentCage = nil