From d7442d771b92b4d1b1c0c762ea6473cb58ece544 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Mon, 6 Nov 2023 02:20:54 +0600 Subject: [PATCH] ScanlatorFilterDialog: Fix crash when no scanlator (#10111) --- .../manga/components/ScanlatorFilterDialog.kt | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/ScanlatorFilterDialog.kt b/app/src/main/java/eu/kanade/presentation/manga/components/ScanlatorFilterDialog.kt index 07d3510d31..dd19e13611 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/ScanlatorFilterDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/ScanlatorFilterDialog.kt @@ -106,27 +106,27 @@ fun ScanlatorFilterDialog( usePlatformDefaultWidth = true, ), confirmButton = { - FlowRow { - if (sortedAvailableScanlators.isEmpty()) { - TextButton(onClick = onDismissRequest) { - Text(text = stringResource(R.string.action_cancel)) - } - return@FlowRow - } - TextButton(onClick = mutableExcludedScanlators::clear) { - Text(text = stringResource(R.string.action_reset)) - } - Spacer(modifier = Modifier.weight(1f)) + if (sortedAvailableScanlators.isEmpty()) { TextButton(onClick = onDismissRequest) { Text(text = stringResource(R.string.action_cancel)) } - TextButton( - onClick = { - onConfirm(mutableExcludedScanlators.toSet()) - onDismissRequest() - }, - ) { - Text(text = stringResource(R.string.action_ok)) + } else { + FlowRow { + TextButton(onClick = mutableExcludedScanlators::clear) { + Text(text = stringResource(R.string.action_reset)) + } + Spacer(modifier = Modifier.weight(1f)) + TextButton(onClick = onDismissRequest) { + Text(text = stringResource(R.string.action_cancel)) + } + TextButton( + onClick = { + onConfirm(mutableExcludedScanlators.toSet()) + onDismissRequest() + }, + ) { + Text(text = stringResource(R.string.action_ok)) + } } } },