fix: surface voice channel full errors for join-voice-listen IPC
Return UI error toast instead of ipc dispatch failed when voice channel is at capacity for listen-only joins. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -458,13 +458,29 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
||||
return true
|
||||
}
|
||||
if (t === 'join-voice') {
|
||||
try {
|
||||
await platform.joinVoiceChannel(msg.channelId)
|
||||
pushState()
|
||||
} catch (err) {
|
||||
if (/voice channel is full/i.test(err?.message || '')) {
|
||||
send({ type: 'error', message: err.message })
|
||||
return true
|
||||
}
|
||||
throw err
|
||||
}
|
||||
return true
|
||||
}
|
||||
if (t === 'join-voice-listen') {
|
||||
try {
|
||||
await platform.joinVoiceListenOnly(msg.channelId)
|
||||
pushState()
|
||||
} catch (err) {
|
||||
if (/voice channel is full/i.test(err?.message || '')) {
|
||||
send({ type: 'error', message: err.message })
|
||||
return true
|
||||
}
|
||||
throw err
|
||||
}
|
||||
return true
|
||||
}
|
||||
if (t === 'leave-voice') {
|
||||
|
||||
Reference in New Issue
Block a user