From 7e3ab23f9bae60b7fea8a69b746f6c0eacaaaeeb Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 2 Dec 2026 18:10:47 +0100 Subject: [PATCH] fix(#199): review - custom colour joins the recents on save --- .../calendula/ui/calendars/CalendarsScreen.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/calendars/CalendarsScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/calendars/CalendarsScreen.kt index f3eee80b..60b9b174 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/calendars/CalendarsScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/calendars/CalendarsScreen.kt @@ -436,6 +436,7 @@ internal fun CalendarEditor( .filter { (it in hiddenViews) != (it in seededHiddenViews) } .associateWith { it in hiddenViews } onSave(name.trim(), color, description.trim().ifEmpty { null }, changes) + if (!sameColor(color, initialColor) && CalendarColorPalette.presetOf(color) == null) onCustomColorUsed(color) } } @@ -478,10 +479,7 @@ internal fun CalendarEditor( selected = color, recents = recentColors, onSelect = { color = it }, - onSelectRecent = { - color = it - onCustomColorUsed(it) - }, + onSelectRecent = { color = it }, ) Spacer(Modifier.height(8.dp)) CustomColorRow(customColor = customColor, onClick = { pickCustomColor = true }) @@ -523,7 +521,6 @@ internal fun CalendarEditor( initial = color, onPick = { color = it - onCustomColorUsed(it) pickCustomColor = false }, onDismiss = { pickCustomColor = false },