hide & disable video functionality on prod

This commit is contained in:
Abi Raja 2024-03-19 13:12:41 -04:00
parent 785a135460
commit b6222ddbc9
2 changed files with 26 additions and 17 deletions

View File

@ -261,6 +261,9 @@ async def stream_code(websocket: WebSocket):
else: else:
try: try:
if validated_input_mode == "video": if validated_input_mode == "video":
if IS_PROD:
raise Exception("Video mode is not supported in prod")
if not ANTHROPIC_API_KEY: if not ANTHROPIC_API_KEY:
await throw_error( await throw_error(
"No Anthropic API key found. Please add the environment variable ANTHROPIC_API_KEY to backend/.env" "No Anthropic API key found. Please add the environment variable ANTHROPIC_API_KEY to backend/.env"

View File

@ -7,6 +7,7 @@ import { URLS } from "../urls";
import { Badge } from "./ui/badge"; import { Badge } from "./ui/badge";
import ScreenRecorder from "./recording/ScreenRecorder"; import ScreenRecorder from "./recording/ScreenRecorder";
import { ScreenRecorderState } from "../types"; import { ScreenRecorderState } from "../types";
import { IS_RUNNING_ON_CLOUD } from "../config";
const baseStyle = { const baseStyle = {
flex: 1, flex: 1,
@ -173,10 +174,13 @@ function ImageUpload({ setReferenceImages }: Props) {
</p> </p>
</div> </div>
)} )}
{/* Disable on prod for now */}
{!IS_RUNNING_ON_CLOUD && (
<>
{screenRecorderState === ScreenRecorderState.INITIAL && ( {screenRecorderState === ScreenRecorderState.INITIAL && (
<div className="text-center text-sm text-slate-800 mt-4"> <div className="text-center text-sm text-slate-800 mt-4">
<Badge>New!</Badge> Upload a screen recording (.mp4, .mov) or record <Badge>New!</Badge> Upload a screen recording (.mp4, .mov) or
your screen to clone a whole app (experimental).{" "} record your screen to clone a whole app (experimental).{" "}
<a <a
className="underline" className="underline"
href={URLS["intro-to-video"]} href={URLS["intro-to-video"]}
@ -191,6 +195,8 @@ function ImageUpload({ setReferenceImages }: Props) {
setScreenRecorderState={setScreenRecorderState} setScreenRecorderState={setScreenRecorderState}
generateCode={setReferenceImages} generateCode={setReferenceImages}
/> />
</>
)}
</section> </section>
); );
} }