[web] Remove ternary statements

This commit is contained in:
Alain Nussbaumer
2025-05-25 10:12:59 +02:00
parent 78ffba97d8
commit b251a4e418
9 changed files with 37 additions and 29 deletions

View File

@@ -25,14 +25,10 @@ export default {
name: 'ControlVolume',
components: { ControlSlider },
setup() {
return {
playerStore: usePlayerStore()
}
return { playerStore: usePlayerStore() }
},
data() {
return {
volume: 0
}
return { volume: 0 }
},
computed: {
icon() {
@@ -54,7 +50,11 @@ export default {
player.setVolume(this.playerStore.volume)
},
toggle() {
this.playerStore.volume = this.playerStore.isMuted ? this.volume : 0
if (this.playerStore.isMuted) {
this.playerStore.volume = this.volume
} else {
this.playerStore.volume = 0
}
this.changeVolume()
}
}

View File

@@ -36,13 +36,9 @@ export default {
ControlSlider
},
props: { output: { required: true, type: Object } },
data() {
return {
volume: this.output.selected ? this.output.volume : 0
}
return { volume: this.output.volume }
},
computed: {
icon() {
if (this.output.type.startsWith('AirPlay')) {
@@ -55,13 +51,11 @@ export default {
return 'server'
}
},
watch: {
output() {
this.volume = this.output.volume
}
},
methods: {
changeVolume() {
player.setVolume(this.volume, this.output.id)

View File

@@ -21,9 +21,10 @@ export default {
},
computed: {
icon() {
return this.playerStore.showLyrics
? 'script-text-play'
: 'script-text-outline'
if (this.playerStore.showLyrics) {
return 'script-text-play'
}
return 'script-text-outline'
}
},
methods: {