mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Make sure deleted highlights are synced to iOS
This commit is contained in:
parent
5e4095f47e
commit
60a663e9bb
1 changed files with 9 additions and 1 deletions
|
|
@ -110,7 +110,15 @@ extension DataService {
|
|||
let highlightObjects = articleProps.highlights.map {
|
||||
$0.asManagedObject(context: self.backgroundContext)
|
||||
}
|
||||
linkedItem.addToHighlights(NSSet(array: highlightObjects))
|
||||
|
||||
let unsyncedHighlights = existingItem?.highlights?.filter { highlight in
|
||||
if let highlight = highlight as? Highlight, highlight.serverSyncStatus == ServerSyncStatus.isNSync.rawValue {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}.compactMap { $0 as? Highlight } ?? []
|
||||
|
||||
linkedItem.highlights = NSSet(array: highlightObjects + unsyncedHighlights)
|
||||
linkedItem.htmlContent = articleProps.htmlContent
|
||||
linkedItem.id = articleProps.item.id
|
||||
linkedItem.state = articleProps.item.state.rawValue
|
||||
|
|
|
|||
Loading…
Reference in a new issue