diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/MangaDialogs.kt b/app/src/main/java/eu/kanade/presentation/manga/components/MangaDialogs.kt index ace822cd1..655601a0a 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/MangaDialogs.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/MangaDialogs.kt @@ -19,6 +19,8 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.dp +import eu.kanade.tachiyomi.util.system.isDevFlavor +import eu.kanade.tachiyomi.util.system.isPreviewBuildType import kotlinx.collections.immutable.toImmutableList import tachiyomi.domain.manga.interactor.FetchInterval import tachiyomi.i18n.MR @@ -72,13 +74,12 @@ fun SetIntervalDialog( val nextUpdateDays = remember(nextUpdate) { return@remember if (nextUpdate != null) { val now = Instant.now() - now.until(nextUpdate, ChronoUnit.DAYS).toInt() + now.until(nextUpdate, ChronoUnit.DAYS).toInt().coerceAtLeast(0) } else { null } } - // TODO: selecting "1" then doesn't allow for future changes unless defaulting first? AlertDialog( onDismissRequest = onDismissRequest, title = { Text(stringResource(MR.strings.pref_library_update_smart_update)) }, @@ -104,7 +105,8 @@ fun SetIntervalDialog( Spacer(Modifier.height(MaterialTheme.padding.small)) } - if (onValueChanged != null) { + // TODO: selecting "1" then doesn't allow for future changes unless defaulting first? + if (onValueChanged != null && (isDevFlavor || isPreviewBuildType)) { Text(stringResource(MR.strings.manga_interval_custom_amount)) BoxWithConstraints( diff --git a/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt b/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt index 283f71bbb..f1d228534 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/components/MangaInfoHeader.kt @@ -182,7 +182,7 @@ fun MangaActionRow( val nextUpdateDays = remember(nextUpdate) { return@remember if (nextUpdate != null) { val now = Instant.now() - now.until(nextUpdate, ChronoUnit.DAYS).toInt() + now.until(nextUpdate, ChronoUnit.DAYS).toInt().coerceAtLeast(0) } else { null }