mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-06 20:33:10 -05:00
[web] Remove button section when not present
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<modal-dialog :actions="actions" :show="show" @close="$emit('close')">
|
||||
<template #content>
|
||||
<list-properties :item="item">
|
||||
<template #buttons>
|
||||
<template v-if="buttons.length" #buttons>
|
||||
<div class="buttons">
|
||||
<a
|
||||
v-for="button in buttons"
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
name: 'ModalDialogPlayable',
|
||||
components: { ListProperties, ModalDialog },
|
||||
props: {
|
||||
buttons: { default: null, type: Array },
|
||||
buttons: { default: () => [], type: Array },
|
||||
item: { required: true, type: Object },
|
||||
show: Boolean
|
||||
},
|
||||
|
||||
@@ -28,17 +28,12 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
buttons() {
|
||||
if (this.item.media_kind === 'podcast') {
|
||||
if (this.item.play_count > 0) {
|
||||
return [{ label: 'dialog.track.mark-as-new', handler: this.mark_new }]
|
||||
}
|
||||
if (this.item.play_count === 0) {
|
||||
return [
|
||||
{ label: 'dialog.track.mark-as-played', handler: this.mark_played }
|
||||
]
|
||||
}
|
||||
if (this.item.media_kind !== 'podcast') {
|
||||
return []
|
||||
}
|
||||
return []
|
||||
return this.item.play_count > 0
|
||||
? [{ label: 'dialog.track.mark-as-new', handler: this.mark_new }]
|
||||
: [{ label: 'dialog.track.mark-as-played', handler: this.mark_played }]
|
||||
},
|
||||
playable() {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user