Add State of Mind to HealthService read types

Include stateOfMindType in the read permissions request so it shows
as enabled by default in the HealthKit authorization dialog.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-20 01:07:35 -06:00
parent 5950ca738b
commit 163e993eb4

View File

@@ -34,9 +34,10 @@ class HealthService: ObservableObject {
private let exerciseTimeType = HKQuantityType.quantityType(forIdentifier: .appleExerciseTime)!
private let heartRateType = HKQuantityType.quantityType(forIdentifier: .heartRate)!
private let sleepAnalysisType = HKCategoryType.categoryType(forIdentifier: .sleepAnalysis)!
private let stateOfMindType = HKSampleType.stateOfMindType()
private var readTypes: Set<HKObjectType> {
[stepCountType, exerciseTimeType, heartRateType, sleepAnalysisType]
[stepCountType, exerciseTimeType, heartRateType, sleepAnalysisType, stateOfMindType]
}
// MARK: - Initialization