show the repeating event update dialog only if the event was repeatable

This commit is contained in:
tibbi 2017-06-13 23:07:13 +02:00
parent 9fd58e7307
commit 1c14ccc8f3
1 changed files with 3 additions and 1 deletions

View File

@ -436,6 +436,8 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
return return
} }
val wasRepeatable = mEvent.repeatInterval > 0
val reminders = sortedSetOf(mReminder1Minutes, mReminder2Minutes, mReminder3Minutes).filter { it != REMINDER_OFF } val reminders = sortedSetOf(mReminder1Minutes, mReminder2Minutes, mReminder3Minutes).filter { it != REMINDER_OFF }
val dbHelper = DBHelper.newInstance(applicationContext, this) val dbHelper = DBHelper.newInstance(applicationContext, this)
val newDescription = event_description.value val newDescription = event_description.value
@ -459,7 +461,7 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
if (mEvent.id == 0) { if (mEvent.id == 0) {
dbHelper.insert(mEvent) dbHelper.insert(mEvent)
} else { } else {
if (mRepeatInterval > 0) { if (mRepeatInterval > 0 && wasRepeatable) {
EditRepeatingEventDialog(this) { EditRepeatingEventDialog(this) {
if (it) { if (it) {
dbHelper.update(mEvent) dbHelper.update(mEvent)