Skip to content

Commit f968553

Browse files
NikitatopodinНикита Быковский
andauthored
fix(useDeviceList): audioInputs doesn't update if camera permission is granted (#4559)
Co-authored-by: Никита Быковский <bykovskii@trueconf.loc>
1 parent 9ba07a2 commit f968553

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/useDevicesList/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@ export function useDevicesList(options: UseDevicesListOptions = {}): UseDevicesL
7373
}
7474

7575
async function ensurePermissions() {
76+
const deviceName = constraints.video ? 'camera' : 'microphone'
77+
7678
if (!isSupported.value)
7779
return false
7880

7981
if (permissionGranted.value)
8082
return true
8183

82-
const { state, query } = usePermission('camera', { controls: true })
84+
const { state, query } = usePermission(deviceName, { controls: true })
8385
await query()
8486
if (state.value !== 'granted') {
8587
let granted = true

0 commit comments

Comments
 (0)