Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(permissions): show request permission for camera

r17x842953601293
diff --git a/apps/desktop/src/routes/(window-chrome)/index.tsx b/apps/desktop/src/routes/(window-chrome)/index.tsx
index ed8dee583..1879334d6 100644
--- a/apps/desktop/src/routes/(window-chrome)/index.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/index.tsx
@@ -346,6 +346,7 @@ export default function() {
e.preventDefault();
}}
onClick={(e) => {
+ if (check?.latest?.camera !== 'granted') { commands.openPermissionSettings('camera') };
e.stopPropagation();
e.preventDefault();
const device = camera()
@@ -358,7 +359,7 @@ export default function() {
}
}}
>
- {camera()?.deviceId ? "On" : "Off"}
+ {check?.latest?.camera !== 'granted' ? "Request Permission" : camera()?.deviceId ? "On" : "Off"}
</button>
</KSelect.Trigger>
<KSelect.Portal>
diff --git a/apps/desktop/src/routes/permissions.tsx b/apps/desktop/src/routes/permissions.tsx
index b3d2cc200..143e3e721 100644
--- a/apps/desktop/src/routes/permissions.tsx
+++ b/apps/desktop/src/routes/permissions.tsx
@@ -20,7 +20,6 @@ function isPermitted(status?: OSPermissionStatus): boolean {
export default function() {
const steps = [
{ name: "Screen Recording", key: "screenRecording" as const },
- { name: "Camera", key: "camera" as const },
{ name: "Accessibility", key: "accessibility" as const },
] as const;