From 95190ec6901657062ead1fbf3d4c4cbec92d396c Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Fri, 8 Aug 2025 14:06:37 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(frontend)=20add=20global=20store=20fo?= =?UTF-8?q?r=20browser=20permissions=20monitoring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/frontend/src/stores/permissions.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/frontend/src/stores/permissions.ts diff --git a/src/frontend/src/stores/permissions.ts b/src/frontend/src/stores/permissions.ts new file mode 100644 index 00000000..1f1f79d6 --- /dev/null +++ b/src/frontend/src/stores/permissions.ts @@ -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({ + cameraPermission: undefined, + microphonePermission: undefined, +})