Release Candidate Version 1.6

This commit is contained in:
Vicnet
2023-12-15 13:43:56 +01:00
parent 222685e05d
commit bb68b29bdf
16 changed files with 1020 additions and 275 deletions

View File

@@ -173,6 +173,10 @@ struct RecipeKeyword: Codable {
let recipe_count: Int
}
struct RecipeImportRequest: Codable {
let url: String
}

View File

@@ -79,6 +79,24 @@ class UserSettings: ObservableObject {
}
}
@Published var expandNutritionSection: Bool {
didSet {
UserDefaults.standard.set(expandNutritionSection, forKey: "expandNutritionSection")
}
}
@Published var expandKeywordSection: Bool {
didSet {
UserDefaults.standard.set(expandKeywordSection, forKey: "expandKeywordSection")
}
}
@Published var expandInfoSection: Bool {
didSet {
UserDefaults.standard.set(expandInfoSection, forKey: "expandInfoSection")
}
}
init() {
self.username = UserDefaults.standard.object(forKey: "username") as? String ?? ""
self.token = UserDefaults.standard.object(forKey: "token") as? String ?? ""
@@ -91,6 +109,9 @@ class UserSettings: ObservableObject {
self.storeImages = UserDefaults.standard.object(forKey: "storeImages") as? Bool ?? true
self.storeThumb = UserDefaults.standard.object(forKey: "storeThumb") as? Bool ?? true
self.lastUpdate = UserDefaults.standard.object(forKey: "lastUpdate") as? Date ?? Date.distantPast
self.expandNutritionSection = UserDefaults.standard.object(forKey: "expandNutritionSection") as? Bool ?? false
self.expandKeywordSection = UserDefaults.standard.object(forKey: "expandKeywordSection") as? Bool ?? false
self.expandInfoSection = UserDefaults.standard.object(forKey: "expandInfoSection") as? Bool ?? false
if authString == "" {
if token != "" && username != "" {