diff --git a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt index a09dbbe..f9cafcc 100644 --- a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt +++ b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/NoteTint.kt @@ -237,8 +237,7 @@ fun noteTintFor(note: Note): NoteTint = * Not `@Composable`: the card needs it alongside `isSystemInDarkTheme()`, and keeping * it an ordinary function means it can be read anywhere the note is. */ -fun noteIsStrong(note: Note): Boolean = - noteColorIsChosen(note.color, firstLabelColor(note), NOTE_TINTS.keys) +fun noteIsStrong(note: Note): Boolean = noteColorIsChosen(note.color, firstLabelColor(note), NOTE_TINTS.keys) /** * The colour of the note's FIRST label, already resolved, or "" when it has none. @@ -249,10 +248,10 @@ fun noteIsStrong(note: Note): Boolean = * a chip cannot tell which kind they made, and two identically-tagged notes in * different colours for an invisible reason is worse than the rule being loose. */ -private fun firstLabelColor(note: Note): String = - note.labels.firstOrNull() - ?.let { resolvedLabelColor(it.name, it.color, NOTE_TINTS.keys) } - ?: "" +private fun firstLabelColor(note: Note): String { + val first = note.labels.firstOrNull() ?: return "" + return resolvedLabelColor(first.name, first.color, NOTE_TINTS.keys) +} /** * The tint for a LABEL, derived from its name when nobody has picked one.