Skip to content

Commit d3d63b2

Browse files
authored
Fix viewUpdateNSBG: re-declare lastBGTime local (#595)
Restore `let lastBGTime = entries[latestEntryIndex].date` in viewUpdateNSBG. Dev currently fails to compile with "Cannot find 'lastBGTime' in scope" because two PRs that merged into dev on the same day textually did not conflict but semantically interfered: - #537 (Live Activity) added `Storage.shared.lastBgReadingTimeSeconds.value = lastBGTime` later in the function, relying on the existing local. - #565 (Display HIGH/LOW) removed the local declaration as part of an unrelated refactor; that branch was cut before #537 landed, so from its perspective the local was unused. Git's 3-way merge produced a syntactically clean file but the surviving reference now dangles. Re-adding the local is the minimal, intent-preserving fix.
1 parent 9f00810 commit d3d63b2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

LoopFollow/Controllers/Nightscout/BGData.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ extension MainViewController {
236236
let latestBG = entries[latestEntryIndex].sgv
237237
let priorBG = entries[latestEntryIndex - 1].sgv
238238
let deltaBG = latestBG - priorBG
239+
let lastBGTime = entries[latestEntryIndex].date
239240

240241
self.updateServerText(with: sourceName)
241242

0 commit comments

Comments
 (0)