mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 20:30:58 +01:00
fix some glitches related to duplicating events
This commit is contained in:
parent
7f36b62798
commit
7985112082
@ -95,10 +95,10 @@ class EventActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (intent.getBooleanExtra(IS_DUPLICATE_INTENT, false)) {
|
if (intent.getBooleanExtra(IS_DUPLICATE_INTENT, false)) {
|
||||||
mEvent.id = 0
|
mEvent.id = null
|
||||||
}
|
} else {
|
||||||
|
|
||||||
cancelNotification(mEvent.id!!)
|
cancelNotification(mEvent.id!!)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mEvent = Event(null)
|
mEvent = Event(null)
|
||||||
config.apply {
|
config.apply {
|
||||||
|
@ -128,6 +128,10 @@ class EventsHelper(val context: Context) {
|
|||||||
fun deleteEvent(id: Long, deleteFromCalDAV: Boolean) = deleteEvents(arrayListOf(id), deleteFromCalDAV)
|
fun deleteEvent(id: Long, deleteFromCalDAV: Boolean) = deleteEvents(arrayListOf(id), deleteFromCalDAV)
|
||||||
|
|
||||||
fun deleteEvents(ids: MutableList<Long>, deleteFromCalDAV: Boolean) {
|
fun deleteEvents(ids: MutableList<Long>, deleteFromCalDAV: Boolean) {
|
||||||
|
if (ids.isEmpty()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
val eventsWithImportId = eventsDB.getEventsByIdsWithImportIds(ids)
|
val eventsWithImportId = eventsDB.getEventsByIdsWithImportIds(ids)
|
||||||
eventsDB.deleteEvents(ids)
|
eventsDB.deleteEvents(ids)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user