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