Phase 441: surface voice/stage connect permission errors to UI.

Return IPC error toasts for no-permission and listen-only join failures
on join-voice, join-voice-listen, and join-stage handlers.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-23 19:25:31 -04:00
co-authored by Cursor
parent 75267b90e6
commit 3ca86dc059
+21 -6
View File
@@ -514,8 +514,13 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
await platform.joinStageChannel(msg.channelId)
pushState()
} catch (err) {
if (/voice channel is full/i.test(err?.message || '')) {
send({ type: 'error', message: err.message })
const errMsg = err?.message || String(err)
if (/voice channel is full/i.test(errMsg)) {
send({ type: 'error', message: errMsg })
return true
}
if (/no permission to connect/i.test(errMsg)) {
send({ type: 'error', message: errMsg })
return true
}
throw err
@@ -563,8 +568,13 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
await platform.joinVoiceChannel(msg.channelId)
pushState()
} catch (err) {
if (/voice channel is full/i.test(err?.message || '')) {
send({ type: 'error', message: err.message })
const errMsg = err?.message || String(err)
if (/voice channel is full/i.test(errMsg)) {
send({ type: 'error', message: errMsg })
return true
}
if (/no permission to connect|cannot join voice listen-only/i.test(errMsg)) {
send({ type: 'error', message: errMsg })
return true
}
throw err
@@ -576,8 +586,13 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
await platform.joinVoiceListenOnly(msg.channelId)
pushState()
} catch (err) {
if (/voice channel is full/i.test(err?.message || '')) {
send({ type: 'error', message: err.message })
const errMsg = err?.message || String(err)
if (/voice channel is full/i.test(errMsg)) {
send({ type: 'error', message: errMsg })
return true
}
if (/no permission to connect|cannot join voice listen-only/i.test(errMsg)) {
send({ type: 'error', message: errMsg })
return true
}
throw err