mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-24 03:27:46 -05:00
[web] Remove ternary statements
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user