Fix CrashlyticsService API signature and unused tagMap warning
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -75,7 +75,6 @@ struct AutocompleteEngine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static func findViolations(plan: WeekPlan, allDishes: [Dish], allTags: [Tag]) -> [RuleViolation] {
|
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) })
|
let dishMap = Dictionary(uniqueKeysWithValues: allDishes.map { ($0.id, $0) })
|
||||||
return plan.slots.compactMap { slot in
|
return plan.slots.compactMap { slot in
|
||||||
guard let dishId = slot.dishId,
|
guard let dishId = slot.dishId,
|
||||||
|
|||||||
@@ -11,16 +11,18 @@ enum CrashlyticsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static func record(_ error: Error, context: String? = nil) {
|
static func record(_ error: Error, context: String? = nil) {
|
||||||
var userInfo: [String: Any] = [:]
|
if let context {
|
||||||
if let context { userInfo["context"] = context }
|
Crashlytics.crashlytics().setCustomValue(context, forKey: "context")
|
||||||
Crashlytics.crashlytics().record(error: error, userInfo: userInfo)
|
}
|
||||||
|
Crashlytics.crashlytics().record(error: error)
|
||||||
}
|
}
|
||||||
|
|
||||||
static func record(message: String, context: String? = nil) {
|
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(
|
Crashlytics.crashlytics().record(
|
||||||
exceptionModel: ExceptionModel(name: "AppError", reason: message),
|
exceptionModel: ExceptionModel(name: "AppError", reason: message)
|
||||||
userInfo: userInfo
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user