From deea44a4b73c8b81b5e22f1f6f5a4e9920a8248d Mon Sep 17 00:00:00 2001 From: Jacob Schlecht Date: Tue, 4 Aug 2026 22:19:35 -0600 Subject: [PATCH] fix: Use find function here Signed-off-by: Jacob Schlecht --- src/native/virtualMic.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/native/virtualMic.ts b/src/native/virtualMic.ts index 3eeb01b..55076b5 100644 --- a/src/native/virtualMic.ts +++ b/src/native/virtualMic.ts @@ -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; } }