From b6222ddbc9ce440a00ffeadb6cdcdadd3216168b Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Tue, 19 Mar 2024 13:12:41 -0400 Subject: [PATCH] hide & disable video functionality on prod --- backend/routes/generate_code.py | 3 ++ frontend/src/components/ImageUpload.tsx | 40 ++++++++++++++----------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.py index feb4664..578b79a 100644 --- a/backend/routes/generate_code.py +++ b/backend/routes/generate_code.py @@ -261,6 +261,9 @@ async def stream_code(websocket: WebSocket): else: try: if validated_input_mode == "video": + if IS_PROD: + raise Exception("Video mode is not supported in prod") + if not ANTHROPIC_API_KEY: await throw_error( "No Anthropic API key found. Please add the environment variable ANTHROPIC_API_KEY to backend/.env" diff --git a/frontend/src/components/ImageUpload.tsx b/frontend/src/components/ImageUpload.tsx index 366f104..8573824 100644 --- a/frontend/src/components/ImageUpload.tsx +++ b/frontend/src/components/ImageUpload.tsx @@ -7,6 +7,7 @@ import { URLS } from "../urls"; import { Badge } from "./ui/badge"; import ScreenRecorder from "./recording/ScreenRecorder"; import { ScreenRecorderState } from "../types"; +import { IS_RUNNING_ON_CLOUD } from "../config"; const baseStyle = { flex: 1, @@ -173,24 +174,29 @@ function ImageUpload({ setReferenceImages }: Props) {

)} - {screenRecorderState === ScreenRecorderState.INITIAL && ( -
- New! Upload a screen recording (.mp4, .mov) or record - your screen to clone a whole app (experimental).{" "} - - Learn more. - -
+ {/* Disable on prod for now */} + {!IS_RUNNING_ON_CLOUD && ( + <> + {screenRecorderState === ScreenRecorderState.INITIAL && ( +
+ New! Upload a screen recording (.mp4, .mov) or + record your screen to clone a whole app (experimental).{" "} + + Learn more. + +
+ )} + + )} - ); }