Fix newly created statuses/accounts not having lastFetchedAt set

awakeFromFetch is only called on existing objects
This commit is contained in:
Shadowfacts 2022-05-06 10:24:50 -04:00
parent 5f566724bb
commit 0b6c16b0a6
2 changed files with 2 additions and 0 deletions

View File

@ -61,6 +61,7 @@ extension AccountMO {
convenience init(apiAccount account: Pachyderm.Account, container: MastodonCachePersistentStore, context: NSManagedObjectContext) {
self.init(context: context)
self.updateFrom(apiAccount: account, container: container)
self.lastFetchedAt = Date()
}
func updateFrom(apiAccount account: Pachyderm.Account, container: MastodonCachePersistentStore) {

View File

@ -91,6 +91,7 @@ extension StatusMO {
convenience init(apiStatus status: Pachyderm.Status, container: MastodonCachePersistentStore, context: NSManagedObjectContext) {
self.init(context: context)
self.updateFrom(apiStatus: status, container: container)
self.lastFetchedAt = Date()
}
func updateFrom(apiStatus status: Pachyderm.Status, container: MastodonCachePersistentStore) {