Simplify code in missing chapters warning (#9263)

This commit is contained in:
stevenyomi 2023-03-26 23:50:29 +08:00 committed by GitHub
parent 1ff78173f7
commit 0bcc22822d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,10 +52,9 @@ private fun MissingChaptersWarning(count: Int?) {
val text = when { val text = when {
count == null -> stringResource(R.string.missing_chapters_unknown) count == null -> stringResource(R.string.missing_chapters_unknown)
count > 0 -> pluralStringResource(id = R.plurals.missing_chapters, count = count, count) count > 0 -> pluralStringResource(id = R.plurals.missing_chapters, count = count, count)
else -> null else -> return
} }
if (text != null) {
Text( Text(
modifier = Modifier.secondaryItemAlpha(), modifier = Modifier.secondaryItemAlpha(),
text = text, text = text,
@ -65,4 +64,3 @@ private fun MissingChaptersWarning(count: Int?) {
color = MaterialTheme.colorScheme.error, color = MaterialTheme.colorScheme.error,
) )
} }
}