if a local google event was deleted after inserting while offline, forget it

This commit is contained in:
tibbi 2017-07-27 23:00:56 +02:00
parent e3dabf8ce5
commit 386c48bc56

View File

@ -39,12 +39,16 @@ class GoogleSyncQueueDB private constructor(val context: Context) : SQLiteOpenHe
}
fun addOperation(eventId: Int, operation: Int) {
val hadInsertOperation = getOperationOf(eventId)?.operation?.equals(OPERATION_INSERT) == true
if (operation == OPERATION_DELETE) {
clearOperationsOf(eventId)
if (hadInsertOperation) {
return
}
}
if (operation == OPERATION_UPDATE) {
if (getOperationOf(eventId)?.operation?.equals(OPERATION_INSERT) == true) {
if (hadInsertOperation) {
return
}
}