Skip to content

Commit

Permalink
fix: remove error logs (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
mccarthytyler authored and GitHub Enterprise committed Oct 8, 2021
1 parent caafd75 commit 8a3817e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,17 @@ async function checkDevicePermissions(deviceKinds: DeviceKind[]): Promise<boolea
if (permissions.every((permission: PermissionStatus) => permission.state === 'granted')) {
return true;
}
} catch (e: unknown) {
error(e);
}
// eslint-disable-next-line no-empty
} catch (e: unknown) {}

try {
const devices: MediaDeviceInfo[] = await enumerateDevices();
// If permissions are granted, the MediaDeviceInfo objects will have labels.
return devices
.filter((device: MediaDeviceInfo) => deviceKinds.includes(device.kind as DeviceKind))
.every((device: MediaDeviceInfo) => device.label);
} catch (e: unknown) {
error(e);
}
// eslint-disable-next-line no-empty
} catch (e: unknown) {}

return false;
}
Expand Down

0 comments on commit 8a3817e

Please sign in to comment.