mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
fix(permissions): map not-determined media status to prompt (#2364)
This commit is contained in:
1 parent
ea6c417378
commit
e836686a71
1 file changed
+10
-1
@@ -52,7 +52,16 @@ class MediaPermission {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private permissionStateFromNativeStatus(status: NativePermissionResult): PermissionState {
|
private permissionStateFromNativeStatus(status: NativePermissionResult): PermissionState {
|
||||||
return status === 'granted' ? 'granted' : 'denied';
|
switch (status) {
|
||||||
|
case 'granted':
|
||||||
|
return 'granted';
|
||||||
|
case 'denied':
|
||||||
|
return 'denied';
|
||||||
|
case 'not-determined':
|
||||||
|
return 'prompt';
|
||||||
|
case 'unsupported':
|
||||||
|
throw new Error('Unsupported native permission status cannot be mapped to a browser permission state');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private applyNativeStatus(kind: 'microphone' | 'camera' | 'screen', status: NativePermissionResult): void {
|
private applyNativeStatus(kind: 'microphone' | 'camera' | 'screen', status: NativePermissionResult): void {
|
||||||
|
|||||||
Reference in new issue
Block a user