From c21a68c807dcb84b4ce910ee0f73238a8019ffe9 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Tue, 8 Jul 2025 21:21:08 +0200 Subject: Allow export/import of preferences --- Map/Presentation/Preferences/StagesPreferencesView.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Map/Presentation/Preferences/StagesPreferencesView.swift') 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 } } -- cgit