fix: Don't send audio as undefined and instead omit it (#241)

Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
This commit is contained in:
Jacob Schlecht 2026-07-17 12:17:16 -06:00 committed by GitHub
parent a5664a35b7
commit dc20b6e232
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 8 deletions

View File

@ -202,9 +202,13 @@ export function createMainWindow() {
if (sources.length == 1) { if (sources.length == 1) {
// TODO: Get audio to work with wayland // TODO: Get audio to work with wayland
// See vencord for an implementation using a virtual microphone. // See vencord for an implementation using a virtual microphone.
callback({ request.audioRequested
? callback({
video: sources[0],
audio: "loopback",
})
: callback({
video: sources[0], video: sources[0],
audio: request.audioRequested ? "loopback" : undefined,
}); });
return; return;
} }
@ -214,9 +218,13 @@ export function createMainWindow() {
if (idx < 0 || idx > sources.length) { if (idx < 0 || idx > sources.length) {
callback({}); callback({});
} else { } else {
callback({ audio
? callback({
video: sources[idx],
audio: "loopback",
})
: callback({
video: sources[idx], video: sources[idx],
audio: audio ? "loopback" : undefined,
}); });
} }
}, },