mirror of
https://github.com/onyx-and-iris/meld-cli.git
synced 2025-07-12 02:11:46 +00:00
fixes regression with audio mute
add guard clauses to audio toggle/status in case audioName wasn't given
This commit is contained in:
parent
fe512ef04c
commit
1eb72f6bf8
10
index.js
10
index.js
@ -98,7 +98,7 @@ socket.onopen = function () {
|
|||||||
withChannel(socket, (channel) => audioList(channel, flags.id))
|
withChannel(socket, (channel) => audioList(channel, flags.id))
|
||||||
break
|
break
|
||||||
case 'mute':
|
case 'mute':
|
||||||
if (!audioName) {
|
if (!audioArguments[0]) {
|
||||||
console.error('Error: Audio name is required for the mute command.')
|
console.error('Error: Audio name is required for the mute command.')
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
@ -112,9 +112,17 @@ socket.onopen = function () {
|
|||||||
withChannel(socket, (channel) => audioUnmute(channel, audioArguments[0]))
|
withChannel(socket, (channel) => audioUnmute(channel, audioArguments[0]))
|
||||||
break
|
break
|
||||||
case 'toggle':
|
case 'toggle':
|
||||||
|
if (!audioArguments[0]) {
|
||||||
|
console.error('Error: Audio name is required for the toggle command.')
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
withChannel(socket, (channel) => audioToggle(channel, audioArguments[0]))
|
withChannel(socket, (channel) => audioToggle(channel, audioArguments[0]))
|
||||||
break
|
break
|
||||||
case 'status':
|
case 'status':
|
||||||
|
if (!audioArguments[0]) {
|
||||||
|
console.error('Error: Audio name is required for the status command.')
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
withChannel(socket, (channel) => audioStatus(channel, audioArguments[0]))
|
withChannel(socket, (channel) => audioStatus(channel, audioArguments[0]))
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user