fix: delete relationship missing for Status issue

This commit is contained in:
CMK 2021-06-21 16:37:28 +08:00
parent 0cda0a58ff
commit a9cce7b3e3
1 changed files with 8 additions and 0 deletions

View File

@ -117,6 +117,14 @@ extension APIService {
} }
}() }()
if let status = oldStatus { if let status = oldStatus {
let homeTimelineIndexes = status.homeTimelineIndexes ?? Set()
for homeTimelineIndex in homeTimelineIndexes {
self.backgroundManagedObjectContext.delete(homeTimelineIndex)
}
let inNotifications = status.inNotifications ?? Set()
for notification in inNotifications {
self.backgroundManagedObjectContext.delete(notification)
}
self.backgroundManagedObjectContext.delete(status) self.backgroundManagedObjectContext.delete(status)
} }
} }