disable quick filtering if only 1 event type is available

This commit is contained in:
tibbi 2021-07-27 00:01:00 +02:00
parent fa3215f639
commit 27e917c807

View file

@ -82,6 +82,10 @@ class EventsHelper(val context: Context) {
}
eventTypesDB.deleteEventTypes(typesToDelete)
if (getEventTypesSync().size == 1) {
config.quickFilterEventTypes = HashSet()
}
}
fun insertEvent(event: Event, addToCalDAV: Boolean, showToasts: Boolean, callback: ((id: Long) -> Unit)? = null) {
@ -267,10 +271,10 @@ class EventsHelper(val context: Context) {
events.addAll(getRepeatableEventsFor(fromTS, toTS, eventId, applyTypeFilter))
events = events
.asSequence()
.distinct()
.filterNot { it.repetitionExceptions.contains(Formatter.getDayCodeFromTS(it.startTS)) }
.toMutableList() as ArrayList<Event>
.asSequence()
.distinct()
.filterNot { it.repetitionExceptions.contains(Formatter.getDayCodeFromTS(it.startTS)) }
.toMutableList() as ArrayList<Event>
val eventTypeColors = LongSparseArray<Int>()
context.eventTypesDB.getEventTypes().forEach {