Unwrap first canned messages element

This commit is contained in:
Garth Vander Houwen 2025-07-07 14:02:19 -07:00
parent 98bc11cf57
commit 5cf8a63108
2 changed files with 3 additions and 3 deletions

View file

@ -517,11 +517,11 @@ func adminAppPacket (packet: MeshPacket, context: NSManagedObjectContext) {
.replacingOccurrences(of: "11: ", with: "")
.replacingOccurrences(of: "\"", with: "")
.trimmingCharacters(in: .whitespacesAndNewlines)
.components(separatedBy: "\n")[0]
.components(separatedBy: "\n").first ?? ""
fetchedNode[0].cannedMessageConfig?.messages = messages
do {
try context.save()
Logger.data.info("💾 Updated Canned Messages Messages For: \(fetchedNode[0].num.toHex(), privacy: .public)")
Logger.data.info("💾 Updated Canned Messages Messages For: \(fetchedNode.first?.num.toHex() ?? "Unknown".localized), privacy: .public)")
} catch {
context.rollback()
let nsError = error as NSError

@ -1 +1 @@
Subproject commit 27fac39141d99fe727a0a1824c5397409b1aea75
Subproject commit 816595c8bbdfc3b4388e11348ccd043294d58705