mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
fixing some threading around saving events
This commit is contained in:
@ -993,21 +993,19 @@ class EventActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun saveCurrentEvent() {
|
private fun saveCurrentEvent() {
|
||||||
ensureBackgroundThread {
|
|
||||||
trySaveEvent()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun trySaveEvent() {
|
|
||||||
if (config.wasAlarmWarningShown || (mReminder1Minutes == REMINDER_OFF && mReminder2Minutes == REMINDER_OFF && mReminder3Minutes == REMINDER_OFF)) {
|
if (config.wasAlarmWarningShown || (mReminder1Minutes == REMINDER_OFF && mReminder2Minutes == REMINDER_OFF && mReminder3Minutes == REMINDER_OFF)) {
|
||||||
|
ensureBackgroundThread {
|
||||||
saveEvent()
|
saveEvent()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ConfirmationDialog(this, messageId = R.string.reminder_warning, positive = R.string.ok, negative = 0) {
|
ConfirmationDialog(this, messageId = R.string.reminder_warning, positive = R.string.ok, negative = 0) {
|
||||||
config.wasAlarmWarningShown = true
|
config.wasAlarmWarningShown = true
|
||||||
|
ensureBackgroundThread {
|
||||||
saveEvent()
|
saveEvent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun saveEvent() {
|
private fun saveEvent() {
|
||||||
val newTitle = event_title.value
|
val newTitle = event_title.value
|
||||||
|
Reference in New Issue
Block a user