diff --git a/MealMood/Services/AutocompleteEngine.swift b/MealMood/Services/AutocompleteEngine.swift index 90215b1..330886d 100644 --- a/MealMood/Services/AutocompleteEngine.swift +++ b/MealMood/Services/AutocompleteEngine.swift @@ -75,7 +75,6 @@ struct AutocompleteEngine { } static func findViolations(plan: WeekPlan, allDishes: [Dish], allTags: [Tag]) -> [RuleViolation] { - let tagMap = Dictionary(uniqueKeysWithValues: allTags.map { ($0.id, $0) }) let dishMap = Dictionary(uniqueKeysWithValues: allDishes.map { ($0.id, $0) }) return plan.slots.compactMap { slot in guard let dishId = slot.dishId, diff --git a/MealMood/Services/CrashlyticsService.swift b/MealMood/Services/CrashlyticsService.swift index c4e6913..c640074 100644 --- a/MealMood/Services/CrashlyticsService.swift +++ b/MealMood/Services/CrashlyticsService.swift @@ -11,16 +11,18 @@ enum CrashlyticsService { } static func record(_ error: Error, context: String? = nil) { - var userInfo: [String: Any] = [:] - if let context { userInfo["context"] = context } - Crashlytics.crashlytics().record(error: error, userInfo: userInfo) + if let context { + Crashlytics.crashlytics().setCustomValue(context, forKey: "context") + } + Crashlytics.crashlytics().record(error: error) } static func record(message: String, context: String? = nil) { - let userInfo: [String: Any] = context.map { ["context": $0] } ?? [:] + if let context { + Crashlytics.crashlytics().setCustomValue(context, forKey: "context") + } Crashlytics.crashlytics().record( - exceptionModel: ExceptionModel(name: "AppError", reason: message), - userInfo: userInfo + exceptionModel: ExceptionModel(name: "AppError", reason: message) ) } }