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/Commands/MapCommands.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Map/Presentation/Commands/MapCommands.swift') diff --git a/Map/Presentation/Commands/MapCommands.swift b/Map/Presentation/Commands/MapCommands.swift index 2d9809d..a298956 100644 --- a/Map/Presentation/Commands/MapCommands.swift +++ b/Map/Presentation/Commands/MapCommands.swift @@ -17,9 +17,11 @@ import UniformTypeIdentifiers struct MapCommands: Commands { - @AppStorage("viewStyle") var viewStyle: ViewStyle = .horizontal - @AppStorage("zoom") var zoom = 1.0 - @AppStorage("mapTemplates") private var templatesData: Data = Data() + @AppStorage("viewStyle") var viewStyle: ViewStyle = + ViewStyle(rawValue: UserPreferences.Defaults.viewStyle) ?? .horizontal + @AppStorage("zoom") var zoom = UserPreferences.Defaults.zoom + @AppStorage("mapTemplates") private var templatesData: Data = UserPreferences.Defaults + .mapTemplates @FocusedBinding(\.document) var document: MapDocument? @FocusedValue(\.fileURL) var url: URL? @FocusedBinding(\.selectedEvolution) var selectedEvolution: StageType? -- cgit