mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
When deleting highlights finish core data sync before triggering API sync
This commit is contained in:
parent
89119add8a
commit
13faffffcc
2 changed files with 3 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ import SwiftGraphQL
|
|||
public extension DataService {
|
||||
func deleteHighlight(highlightID: String) {
|
||||
// Update CoreData so view updates immediately
|
||||
viewContext.perform {
|
||||
viewContext.performAndWait {
|
||||
guard let highlight = Highlight.lookup(byID: highlightID, inContext: self.viewContext) else { return }
|
||||
highlight.serverSyncStatus = Int64(ServerSyncStatus.needsDeletion.rawValue)
|
||||
|
||||
|
|
@ -17,9 +17,8 @@ public extension DataService {
|
|||
self.viewContext.rollback()
|
||||
logger.debug("Failed to mark Highlight for deletion: \(error.localizedDescription)")
|
||||
}
|
||||
|
||||
self.syncHighlightDeletion(highlightID: highlightID)
|
||||
}
|
||||
syncHighlightDeletion(highlightID: highlightID)
|
||||
}
|
||||
|
||||
func syncHighlightDeletion(highlightID: String) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue