Skip to content

Commit c25a727

Browse files
committed
Fix minor bug and update comments
1 parent b9d43ee commit c25a727

5 files changed

Lines changed: 6 additions & 5 deletions

File tree

InfiniLink/BLE/BLECharacteristicHandler.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ struct BLECharacteristicHandler {
162162
if stepCount != 0 {
163163
healthKitManager.readCurrentSteps { value, error in
164164
if let error = error {
165+
// If this errors, it's most likely "protected health data is inaccessible" which occurs when the device is locked (iOS will not decrypt health data without being unlocked
165166
log("Error reading current steps: \(error.localizedDescription)", caller: "HealthKitManager")
166167
return
167168
}

InfiniLink/Core/DirectionsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct DirectionsView: View {
1414
@ObservedObject private var mapSearch = MapSearch()
1515

1616
@FocusState private var isSearching: Bool
17-
// TODO: check
17+
// FIXME: this isn't good to set as a static var
1818
@State private var region = MKCoordinateRegion(
1919
center: CLLocationCoordinate2D(latitude: 37.7749, longitude: -122.4194),
2020
span: MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05)

InfiniLink/Utils/FitnessCalculator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ class FitnessCalculator {
135135
let hours = seconds / 3600
136136
let minutes = (seconds % 3600) / 60
137137

138-
if hours > 0 { // TODO: check
139-
return "\(hours) \(full ? "hour" : "hr")\(hours == 1 ? "" : "s")" //
138+
if hours > 0 {
139+
return "\(String(format: "%.1f", hours)) \(full ? "hour" : "hr")\(hours == 1 ? "" : "s")"
140140
} else if minutes > 0 {
141141
return "\(minutes) \(full ? "minute" : "min")\(minutes == 1 ? "" : "s")"
142142
} else {

InfiniLink/Utils/NotificationManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ extension NotificationManager {
164164
func checkAndNotifyForWaterReminders() {
165165
let currentTime = Date()
166166

167-
if let nextReminderCheckDate = nextReminderCheckDate, currentTime >= nextReminderCheckDate {
167+
if let nextReminderCheckDate, currentTime >= nextReminderCheckDate {
168168
if waterReminder {
169169
bleWriteManager.sendNotification(AppNotification(title: NSLocalizedString("Water Reminder", comment: ""), subtitle: NSLocalizedString("It's time to drink water", comment: "")))
170170
}

InfiniLink/Utils/PersonalizationController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class PersonalizationController: ObservableObject {
3131
}
3232

3333
var calculatedWeight: Double {
34-
guard let weight = self.weight, weight > 0 else { return gender == .male ? 68.039 : 54.43 } // TODO: update these averages if needed
34+
guard let weight = self.weight, weight > 0 else { return gender == .male ? 68.039 : 54.43 }
3535

3636
if units == .imperial {
3737
// Convert from kg to lbs

0 commit comments

Comments
 (0)