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,10 +202,14 @@ 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
video: sources[0], ? callback({
audio: request.audioRequested ? "loopback" : undefined, video: sources[0],
}); audio: "loopback",
})
: callback({
video: sources[0],
});
return; return;
} }
ipcMain.once( ipcMain.once(
@ -214,10 +218,14 @@ export function createMainWindow() {
if (idx < 0 || idx > sources.length) { if (idx < 0 || idx > sources.length) {
callback({}); callback({});
} else { } else {
callback({ audio
video: sources[idx], ? callback({
audio: audio ? "loopback" : undefined, video: sources[idx],
}); audio: "loopback",
})
: callback({
video: sources[idx],
});
} }
}, },
); );