fix: health API uses JWT auth, Finance tab replaced with Health
This commit is contained in:
@@ -177,11 +177,9 @@ struct HealthView: View {
|
||||
func loadData(refresh: Bool = false) async {
|
||||
if !refresh { isLoading = true }
|
||||
|
||||
let apiKey = authManager.healthApiKey
|
||||
|
||||
async let r = HealthAPIService.shared.getReadiness(apiKey: apiKey)
|
||||
async let l = HealthAPIService.shared.getLatest(apiKey: apiKey)
|
||||
async let h = HealthAPIService.shared.getHeatmap(apiKey: apiKey, days: 7)
|
||||
async let r = HealthAPIService.shared.getReadiness()
|
||||
async let l = HealthAPIService.shared.getLatest()
|
||||
async let h = HealthAPIService.shared.getHeatmap(days: 7)
|
||||
|
||||
readiness = try? await r
|
||||
latest = try? await l
|
||||
@@ -198,11 +196,6 @@ struct HealthView: View {
|
||||
return
|
||||
}
|
||||
|
||||
guard !authManager.healthApiKey.isEmpty else {
|
||||
showToastMessage("Health API ключ не найден", success: false)
|
||||
return
|
||||
}
|
||||
|
||||
UIImpactFeedbackGenerator(style: .medium).impactOccurred()
|
||||
|
||||
do {
|
||||
|
||||
@@ -16,10 +16,8 @@ struct MainTabView: View {
|
||||
TrackerView()
|
||||
.tabItem { Label("Трекер", systemImage: "chart.bar.fill") }
|
||||
|
||||
if authManager.userId == 1 {
|
||||
FinanceView()
|
||||
.tabItem { Label("Финансы", systemImage: "creditcard.fill") }
|
||||
}
|
||||
HealthView()
|
||||
.tabItem { Label("Здоровье", systemImage: "heart.fill") }
|
||||
|
||||
SavingsView()
|
||||
.tabItem { Label("Накопления", systemImage: "building.columns.fill") }
|
||||
|
||||
Reference in New Issue
Block a user