aboutsummaryrefslogtreecommitdiff
path: root/Map/Presentation/Preferences/StagesPreferencesView.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-07-08 21:21:08 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2025-07-08 21:21:08 +0200
commitc21a68c807dcb84b4ce910ee0f73238a8019ffe9 (patch)
treeae1e5e0fc7a846daf74623c6cd6270612ff0e56f /Map/Presentation/Preferences/StagesPreferencesView.swift
parent8f6da65a680cdd30ec541b3b226137004a1e4681 (diff)
Allow export/import of preferences
Diffstat (limited to 'Map/Presentation/Preferences/StagesPreferencesView.swift')
-rw-r--r--Map/Presentation/Preferences/StagesPreferencesView.swift7
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
}
}