From 386c48bc56b6aec72a93c3b9bfc22d8f2a2425e2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 27 Jul 2017 23:00:56 +0200 Subject: [PATCH] if a local google event was deleted after inserting while offline, forget it --- .../simplemobiletools/calendar/helpers/GoogleSyncQueueDB.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/GoogleSyncQueueDB.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/GoogleSyncQueueDB.kt index 59f870f12..721041676 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/GoogleSyncQueueDB.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/GoogleSyncQueueDB.kt @@ -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 } }