aboutsummaryrefslogtreecommitdiff
path: root/Map/Presentation/Preferences/StagesPreferencesView.swift
diff options
context:
space:
mode:
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
}
}