diff --git a/KisaniCal/Views/SettingsView.swift b/KisaniCal/Views/SettingsView.swift index 06531db..738b16d 100644 --- a/KisaniCal/Views/SettingsView.swift +++ b/KisaniCal/Views/SettingsView.swift @@ -22,6 +22,8 @@ struct SettingsView: View { @AppStorage("googleCalSync") private var googleCalSync = false @AppStorage("iCloudCalSync") private var iCloudCalSync = true @AppStorage("streakGoal") private var streakGoal = 5 + // App-Group store so NotificationManager (which reads UserDefaults.kisani) sees it. + @AppStorage("kisani.periodMilestones", store: UserDefaults.kisani) private var periodMilestones = true // Sheet presentation @State private var showProfile = false @@ -102,6 +104,11 @@ struct SettingsView: View { SttNavRow(icon: "menucard", bg: AppColors.accentSoft, fg: AppColors.accent, label: "Tab Bar", value: "\(showMatrixTab && showWorkoutTab ? "5" : showMatrixTab || showWorkoutTab ? "4" : "3") tabs") { showTabBar = true } SttNavRow(icon: "paintpalette", bg: AppColors.blueSoft, fg: AppColors.blue, label: "Appearance", value: appearanceLabel) { showAppearance = true } SttToggleRow(icon: "bell", bg: AppColors.accentSoft, fg: AppColors.accent, label: "Sounds & Notifications", isOn: $soundsOn) + SttToggleRow(icon: "calendar.badge.clock", bg: AppColors.blueSoft, fg: AppColors.blue, label: "Time Milestones", + isOn: Binding( + get: { periodMilestones }, + set: { periodMilestones = $0 + NotificationManager.shared.reschedule(workoutVM: workoutVM, taskVM: taskVM) })) SttNavRow(icon: "clock", bg: AppColors.greenSoft, fg: AppColors.green, label: "Date & Time", value: dateLabel) { showDateTime = true } SttNavRow(icon: "puzzlepiece", bg: AppColors.yellowSoft, fg: AppColors.yellow, label: "Widgets") { showWidgets = true } SttNavRow(icon: "gearshape", bg: AppColors.surface3(cs), label: "General", isLast: true) { showGeneral = true }