Fix CrashlyticsService API signature and unused tagMap warning

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
alexandrev-tibco
2026-04-27 15:31:54 +02:00
parent 87a0874f2a
commit ac124342fa
2 changed files with 8 additions and 7 deletions
@@ -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,
+8 -6
View File
@@ -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)
)
}
}