Allow inverting single tile for the blocked time areas

This commit is contained in:
Jonas Lochmann 2023-05-01 02:00:00 +02:00
parent 12dfd6d65f
commit e900695cba
No known key found for this signature in database
GPG key ID: 8B8C9AEE10FA5B36

View file

@ -219,7 +219,7 @@ object ManageCategoryBlockedTimes {
val range = Pair(selectedMinuteOfWeek, minute).sorted().let { (from, to) -> BlockedTimesData.Range(from, to) }
val oldBlockedTimeAreas = blockedTimeAreasLive.first()
val willBlockRange = isChild || oldBlockedTimeAreas.ranges.readFrom(range.first).countSetBits(range.last - range.first + 1) < (range.last - range.first) / 2
val willBlockRange = isChild || oldBlockedTimeAreas.ranges.readFrom(range.first).countSetBits(range.last - range.first + 1) <= (range.last - range.first) / 2
val newBlockedTimeAreas = oldBlockedTimeAreas.withUpdatedRange(range, willBlockRange)