Fix downloaded filter unmatched state in manga screen (#8897)

This commit is contained in:
zbue 2023-01-13 11:26:04 +08:00 committed by GitHub
parent db4ae134aa
commit 768bb7b503
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,6 @@ package eu.kanade.presentation.manga
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
@ -76,14 +75,9 @@ fun ChapterSettingsDialog(
) {
when (page) {
0 -> {
val forceDownloaded = manga?.forceDownloaded() == true
FilterPage(
downloadFilter = if (forceDownloaded) {
TriStateFilter.ENABLED_NOT
} else {
manga?.downloadedFilter
} ?: TriStateFilter.DISABLED,
onDownloadFilterChanged = onDownloadFilterChanged.takeUnless { forceDownloaded },
downloadFilter = manga?.downloadedFilter ?: TriStateFilter.DISABLED,
onDownloadFilterChanged = onDownloadFilterChanged.takeUnless { manga?.forceDownloaded() == true },
unreadFilter = manga?.unreadFilter ?: TriStateFilter.DISABLED,
onUnreadFilterChanged = onUnreadFilterChanged,
bookmarkedFilter = manga?.bookmarkedFilter ?: TriStateFilter.DISABLED,
@ -158,7 +152,7 @@ private fun SetAsDefaultDialog(
}
@Composable
private fun ColumnScope.FilterPage(
private fun FilterPage(
downloadFilter: TriStateFilter,
onDownloadFilterChanged: ((TriStateFilter) -> Unit)?,
unreadFilter: TriStateFilter,
@ -184,7 +178,7 @@ private fun ColumnScope.FilterPage(
}
@Composable
private fun ColumnScope.SortPage(
private fun SortPage(
sortingMode: Long,
sortDescending: Boolean,
onItemSelected: (Long) -> Unit,
@ -207,7 +201,7 @@ private fun ColumnScope.SortPage(
}
@Composable
private fun ColumnScope.DisplayPage(
private fun DisplayPage(
displayMode: Long,
onItemSelected: (Long) -> Unit,
) {