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:
parent
f0d9eb0a61
commit
43c0940fa9
2 changed files with 3 additions and 3 deletions
|
|
@ -99,13 +99,13 @@ fun ExtensionIcon(
|
||||||
is Extension.Installed -> {
|
is Extension.Installed -> {
|
||||||
val icon by extension.getIcon(density)
|
val icon by extension.getIcon(density)
|
||||||
when (icon) {
|
when (icon) {
|
||||||
Result.Loading -> Box(modifier = modifier)
|
is Result.Loading -> Box(modifier = modifier)
|
||||||
is Result.Success -> Image(
|
is Result.Success -> Image(
|
||||||
bitmap = (icon as Result.Success<ImageBitmap>).value,
|
bitmap = (icon as Result.Success<ImageBitmap>).value,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
)
|
)
|
||||||
Result.Error -> Image(
|
is Result.Error -> Image(
|
||||||
bitmap = ImageBitmap.imageResource(id = R.mipmap.ic_default_source),
|
bitmap = ImageBitmap.imageResource(id = R.mipmap.ic_default_source),
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ fun MangaCoverDialog(
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
if (onEditClick != null) {
|
if (onEditClick != null && manga.favorite) {
|
||||||
Box {
|
Box {
|
||||||
var expanded by remember { mutableStateOf(false) }
|
var expanded by remember { mutableStateOf(false) }
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue