From 0bcc22822d75e074e18387dc62b73ffa89c429d2 Mon Sep 17 00:00:00 2001 From: stevenyomi <95685115+stevenyomi@users.noreply.github.com> Date: Sun, 26 Mar 2023 23:50:29 +0800 Subject: [PATCH] Simplify code in missing chapters warning (#9263) --- .../manga/components/ChapterHeader.kt | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/ChapterHeader.kt b/app/src/main/java/eu/kanade/presentation/manga/components/ChapterHeader.kt index 0fb4166bc4..1c32c86cd4 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/ChapterHeader.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/ChapterHeader.kt @@ -52,17 +52,15 @@ private fun MissingChaptersWarning(count: Int?) { val text = when { count == null -> stringResource(R.string.missing_chapters_unknown) count > 0 -> pluralStringResource(id = R.plurals.missing_chapters, count = count, count) - else -> null + else -> return } - if (text != null) { - Text( - modifier = Modifier.secondaryItemAlpha(), - text = text, - maxLines = 1, - overflow = TextOverflow.Ellipsis, - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.error, - ) - } + Text( + modifier = Modifier.secondaryItemAlpha(), + text = text, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.error, + ) }