diff --git a/CoreDataStack/Entity/Toot.swift b/CoreDataStack/Entity/Toot.swift index 59ef034dd..a0908d9de 100644 --- a/CoreDataStack/Entity/Toot.swift +++ b/CoreDataStack/Entity/Toot.swift @@ -93,7 +93,7 @@ public extension Toot { } if let emojis = property.emojis { - toot.mutableSetValue(forKey: #keyPath(Toot.mentions)).addObjects(from: emojis) + toot.mutableSetValue(forKey: #keyPath(Toot.emojis)).addObjects(from: emojis) } if let tags = property.tags { @@ -123,10 +123,11 @@ public extension Toot { if let bookmarkedBy = property.bookmarkedBy { toot.mutableSetValue(forKey: #keyPath(Toot.bookmarkedBy)).add(bookmarkedBy) } - if let pinnedBy = property.pinnedBy { - toot.mutableSetValue(forKey: #keyPath(Toot.pinnedBy)) - } - + + // TODO: not implement yet + // if let pinnedBy = property.pinnedBy { + // toot.mutableSetValue(forKey: #keyPath(Toot.pinnedBy)) + // } toot.updatedAt = property.updatedAt toot.deletedAt = property.deletedAt diff --git a/Mastodon/Service/Persist/APIService+Persist+Timeline.swift b/Mastodon/Service/Persist/APIService+Persist+Timeline.swift index 2fc645a88..d3e9ed5eb 100644 --- a/Mastodon/Service/Persist/APIService+Persist+Timeline.swift +++ b/Mastodon/Service/Persist/APIService+Persist+Timeline.swift @@ -72,6 +72,18 @@ extension APIService.Persist { homeTimelineIndexes: nil) Toot.insert(into: managedObjectContext, property: tootProperty, author: author) } - }.eraseToAnyPublisher() + } + .handleEvents(receiveOutput: { result in + switch result { + case .success: + break + case .failure(let error): + #if DEBUG + debugPrint(error) + #endif + assertionFailure(error.localizedDescription) + } + }) + .eraseToAnyPublisher() } }