Only allow edit cover of favorited entries (#785)

* allow edit cover only if manga is favorite

* correctly using `is` condition
This commit is contained in:
Cuong-Tran 2025-03-25 15:23:04 +07:00 committed by GitHub
parent f0d9eb0a61
commit 43c0940fa9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -99,13 +99,13 @@ fun ExtensionIcon(
is Extension.Installed -> {
val icon by extension.getIcon(density)
when (icon) {
Result.Loading -> Box(modifier = modifier)
is Result.Loading -> Box(modifier = modifier)
is Result.Success -> Image(
bitmap = (icon as Result.Success<ImageBitmap>).value,
contentDescription = null,
modifier = modifier,
)
Result.Error -> Image(
is Result.Error -> Image(
bitmap = ImageBitmap.imageResource(id = R.mipmap.ic_default_source),
contentDescription = null,
modifier = modifier,

View file

@ -126,7 +126,7 @@ fun MangaCoverDialog(
),
),
)
if (onEditClick != null) {
if (onEditClick != null && manga.favorite) {
Box {
var expanded by remember { mutableStateOf(false) }
IconButton(