mirror of
https://github.com/fluxerapp/fluxer.git
synced 2026-09-02 21:04:06 +03:00
fix(permissions): map not-determined media status to prompt (#2364)
This commit is contained in:
@@ -52,7 +52,16 @@ class MediaPermission {
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user