@@ -50,7 +50,6 @@ public struct SettingsView: View {
5050 }
5151
5252 case favoriteFoods
53- case therapySettings
5453 }
5554 }
5655
@@ -137,24 +136,6 @@ public struct SettingsView: View {
137136 }
138137 . sheet ( item: $sheet) { sheet in
139138 switch sheet {
140- case . therapySettings:
141- TherapySettingsView (
142- mode: . settings,
143- viewModel: TherapySettingsViewModel (
144- therapySettings: viewModel. therapySettings ( ) ,
145- sensitivityOverridesEnabled: FeatureFlags . sensitivityOverridesEnabled,
146- adultChildInsulinModelSelectionEnabled: FeatureFlags . adultChildInsulinModelSelectionEnabled,
147- delegate: viewModel. therapySettingsViewModelDelegate
148- )
149- )
150- . environmentObject ( displayGlucosePreference)
151- . environment ( \. dismissAction, self . dismiss)
152- . environment ( \. appName, self . appName)
153- . environment ( \. chartColorPalette, . primary)
154- . environment ( \. carbTintColor, self . carbTintColor)
155- . environment ( \. glucoseTintColor, self . glucoseTintColor)
156- . environment ( \. guidanceColors, self . guidanceColors)
157- . environment ( \. insulinTintColor, self . insulinTintColor)
158139 case . favoriteFoods:
159140 FavoriteFoodsView ( )
160141 }
@@ -286,15 +267,37 @@ extension SettingsView {
286267 }
287268 }
288269 }
289-
270+
271+ private var therapySettingsView : some View {
272+ TherapySettingsView (
273+ mode: . settings,
274+ viewModel: TherapySettingsViewModel (
275+ therapySettings: viewModel. therapySettings ( ) ,
276+ sensitivityOverridesEnabled: FeatureFlags . sensitivityOverridesEnabled,
277+ adultChildInsulinModelSelectionEnabled: FeatureFlags . adultChildInsulinModelSelectionEnabled,
278+ delegate: viewModel. therapySettingsViewModelDelegate
279+ )
280+ )
281+ . environmentObject ( displayGlucosePreference)
282+ . environment ( \. dismissAction, self . dismiss)
283+ . environment ( \. appName, self . appName)
284+ . environment ( \. chartColorPalette, . primary)
285+ . environment ( \. carbTintColor, self . carbTintColor)
286+ . environment ( \. glucoseTintColor, self . glucoseTintColor)
287+ . environment ( \. guidanceColors, self . guidanceColors)
288+ . environment ( \. insulinTintColor, self . insulinTintColor)
289+ }
290+
290291 private var configurationSection : some View {
291292 Section ( header: SectionHeader ( label: NSLocalizedString ( " Configuration " , comment: " The title of the Configuration section in settings " ) ) ) {
292- LargeButton ( action: { sheet = . therapySettings } ,
293- includeArrow: true ,
293+ NavigationLink ( destination: therapySettingsView) {
294+ LargeButton ( action: { } ,
295+ includeArrow: false ,
294296 imageView: Image ( " Therapy Icon " ) ,
295297 label: NSLocalizedString ( " Therapy Settings " , comment: " Title text for button to Therapy Settings " ) ,
296298 descriptiveText: NSLocalizedString ( " Diabetes Treatment " , comment: " Descriptive text for Therapy Settings " ) )
297-
299+ }
300+
298301 ForEach ( pluginMenuItems. filter { $0. section == . configuration} ) { item in
299302 item. view
300303 }
0 commit comments