ScanlatorFilterDialog: Fix crash when no scanlator (#10111)

This commit is contained in:
AntsyLich 2023-11-06 02:20:54 +06:00 committed by GitHub
parent 8f22480ec9
commit d7442d771b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))
}
}
}
},