浏览代码

ScanlatorFilterDialog: Fix crash when no scanlator (#10111)

AntsyLich 1 年之前
父节点
当前提交
d7442d771b
共有 1 个文件被更改,包括 18 次插入18 次删除
  1. 18 18
      app/src/main/java/eu/kanade/presentation/manga/components/ScanlatorFilterDialog.kt

+ 18 - 18
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))
+                    }
                 }
             }
         },