diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-08 21:21:08 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-08 21:21:08 +0200 |
| commit | c21a68c807dcb84b4ce910ee0f73238a8019ffe9 (patch) | |
| tree | ae1e5e0fc7a846daf74623c6cd6270612ff0e56f /Map/Presentation/Preferences/StagesPreferencesView.swift | |
| parent | 8f6da65a680cdd30ec541b3b226137004a1e4681 (diff) | |
Allow export/import of preferences
Diffstat (limited to 'Map/Presentation/Preferences/StagesPreferencesView.swift')
| -rw-r--r-- | Map/Presentation/Preferences/StagesPreferencesView.swift | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Map/Presentation/Preferences/StagesPreferencesView.swift b/Map/Presentation/Preferences/StagesPreferencesView.swift index 6d2154c..542a7fe 100644 --- a/Map/Presentation/Preferences/StagesPreferencesView.swift +++ b/Map/Presentation/Preferences/StagesPreferencesView.swift @@ -16,7 +16,8 @@ import SwiftUI struct StagesPreferencesView: View { - @AppStorage("customStages") private var customStagesData: Data = Data() + @AppStorage("customStages") private var customStagesData: Data = UserPreferences.Defaults + .customStages @State private var customStages: [CustomStage] = [] @State private var showingHelpPopover = false @@ -128,10 +129,6 @@ struct StagesPreferencesView: View { private func loadStages() { if let decoded = try? JSONDecoder().decode([CustomStage].self, from: customStagesData) { customStages = decoded - } else { - // First use - create default Cynefin stage - customStages = [CustomStage.cynefinDefault()] - saveStages() // Save the default to UserDefaults } } |