Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(web): detect desktop feature flags from request headers

Richie McIlroy9cb4c0e472d7
diff --git a/apps/web/utils/desktop.ts b/apps/web/utils/desktop.ts
index 431d760df..bb4260140 100644
--- a/apps/web/utils/desktop.ts
+++ b/apps/web/utils/desktop.ts
@@ -10,6 +10,17 @@ export function isFromDesktopSemver(
}
export const UPLOAD_PROGRESS_VERSION = [0, 3, 68] as const;
+export const GOOGLE_DRIVE_UPLOAD_FEATURE = "googleDriveUpload";
+
+export function hasDesktopFeature(request: HonoRequest, feature: string) {
+ return (
+ request
+ .header("X-Cap-Desktop-Features")
+ ?.split(",")
+ .map((value) => value.trim())
+ .includes(feature) ?? false
+ );
+}
export function isAtLeastSemver(
versionString: string,