✨(frontend) add global store for browser permissions monitoring
Introduce new global state management to watch and expose browser permissions status across the application. Sets foundation for upcoming changes that will prevent the app from offering hardware features (camera/microphone) when permissions are not granted, improving user experience and reducing confusion.
This commit is contained in:
committed by
aleb_the_flash
parent
adb99cc5d9
commit
95190ec690
18
src/frontend/src/stores/permissions.ts
Normal file
18
src/frontend/src/stores/permissions.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { proxy } from 'valtio'
|
||||
|
||||
type PermissionState =
|
||||
| undefined
|
||||
| 'granted'
|
||||
| 'prompt'
|
||||
| 'denied'
|
||||
| 'unavailable'
|
||||
|
||||
type State = {
|
||||
cameraPermission: PermissionState
|
||||
microphonePermission: PermissionState
|
||||
}
|
||||
|
||||
export const permissionsStore = proxy<State>({
|
||||
cameraPermission: undefined,
|
||||
microphonePermission: undefined,
|
||||
})
|
||||
Reference in New Issue
Block a user