Fix share menu item not appearing for entries not in library

This commit is contained in:
arkon 2022-10-30 10:48:21 -04:00
parent 11cc789e36
commit fcec1581b7

View file

@ -156,7 +156,7 @@ fun MangaToolbar(
Icon(Icons.Outlined.FilterList, contentDescription = stringResource(R.string.action_filter), tint = filterTint) Icon(Icons.Outlined.FilterList, contentDescription = stringResource(R.string.action_filter), tint = filterTint)
} }
if (onClickEditCategory != null && onClickMigrate != null) { if (onClickEditCategory != null || onClickMigrate != null || onClickShare != null) {
var moreExpanded by remember { mutableStateOf(false) } var moreExpanded by remember { mutableStateOf(false) }
Box { Box {
IconButton(onClick = { moreExpanded = !moreExpanded }) { IconButton(onClick = { moreExpanded = !moreExpanded }) {
@ -170,20 +170,24 @@ fun MangaToolbar(
expanded = moreExpanded, expanded = moreExpanded,
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
) { ) {
DropdownMenuItem( if (onClickEditCategory != null) {
text = { Text(text = stringResource(R.string.action_edit_categories)) }, DropdownMenuItem(
onClick = { text = { Text(text = stringResource(R.string.action_edit_categories)) },
onClickEditCategory() onClick = {
onDismissRequest() onClickEditCategory()
}, onDismissRequest()
) },
DropdownMenuItem( )
text = { Text(text = stringResource(R.string.action_migrate)) }, }
onClick = { if (onClickMigrate != null) {
onClickMigrate() DropdownMenuItem(
onDismissRequest() text = { Text(text = stringResource(R.string.action_migrate)) },
}, onClick = {
) onClickMigrate()
onDismissRequest()
},
)
}
if (onClickShare != null) { if (onClickShare != null) {
DropdownMenuItem( DropdownMenuItem(
text = { Text(text = stringResource(R.string.action_share)) }, text = { Text(text = stringResource(R.string.action_share)) },