Lookup highlight from store before syncing deletion changes so we have the latest copy in memory

This commit is contained in:
Jackson Harper 2023-02-06 15:19:30 +08:00
parent 1cffdf2bbe
commit 5c636e7482

View file

@ -59,14 +59,14 @@ public extension DataService {
highlight.remove(inContext: context)
} else {
highlight.serverSyncStatus = Int64(ServerSyncStatus.needsDeletion.rawValue)
}
do {
try context.save()
logger.debug("Highlight deleted succesfully")
} catch {
context.rollback()
logger.debug("Failed to delete Highlight: \(error.localizedDescription)")
}
do {
try context.save()
logger.debug("Highlight deleted succesfully")
} catch {
context.rollback()
logger.debug("Failed to delete Highlight: \(error.localizedDescription)")
}
}
}