fix: Use find function here

Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
This commit is contained in:
Jacob Schlecht 2026-08-04 22:19:35 -06:00
parent e8f91e4e23
commit deea44a4b7
1 changed files with 2 additions and 9 deletions

View File

@ -37,7 +37,7 @@ export async function initVirtualMic() {
// Wait for pipewire thread to start and gather neccessary data
await delay(100);
let nodes = getNodes();
let nodes: any[] = getNodes();
let sinkFound = false;
let sourceFound = false;
@ -120,14 +120,7 @@ export async function initVirtualMic() {
// Cleanup savedNodes for nodes that are gone
for (const id in savedNodes) {
const asNum = Number(id);
let found = false;
for (const node of nodes) {
if (node.id === asNum) {
found = true;
break;
}
}
if (!found) {
if (!nodes.find((node) => node.id === asNum)) {
savedNodes[asNum] = void 0;
}
}