fix some glitches related to duplicating events
This commit is contained in:
parent
7f36b62798
commit
7985112082
2 changed files with 7 additions and 3 deletions
|
@ -95,10 +95,10 @@ class EventActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
if (intent.getBooleanExtra(IS_DUPLICATE_INTENT, false)) {
|
||||
mEvent.id = 0
|
||||
mEvent.id = null
|
||||
} else {
|
||||
cancelNotification(mEvent.id!!)
|
||||
}
|
||||
|
||||
cancelNotification(mEvent.id!!)
|
||||
} else {
|
||||
mEvent = Event(null)
|
||||
config.apply {
|
||||
|
|
|
@ -128,6 +128,10 @@ class EventsHelper(val context: Context) {
|
|||
fun deleteEvent(id: Long, deleteFromCalDAV: Boolean) = deleteEvents(arrayListOf(id), deleteFromCalDAV)
|
||||
|
||||
fun deleteEvents(ids: MutableList<Long>, deleteFromCalDAV: Boolean) {
|
||||
if (ids.isEmpty()) {
|
||||
return
|
||||
}
|
||||
|
||||
val eventsWithImportId = eventsDB.getEventsByIdsWithImportIds(ids)
|
||||
eventsDB.deleteEvents(ids)
|
||||
|
||||
|
|
Loading…
Reference in a new issue