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:
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"

View File

@ -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) {
</p>
</div>
)}
{screenRecorderState === ScreenRecorderState.INITIAL && (
<div className="text-center text-sm text-slate-800 mt-4">
<Badge>New!</Badge> Upload a screen recording (.mp4, .mov) or record
your screen to clone a whole app (experimental).{" "}
<a
className="underline"
href={URLS["intro-to-video"]}
target="_blank"
>
Learn more.
</a>
</div>
{/* Disable on prod for now */}
{!IS_RUNNING_ON_CLOUD && (
<>
{screenRecorderState === ScreenRecorderState.INITIAL && (
<div className="text-center text-sm text-slate-800 mt-4">
<Badge>New!</Badge> Upload a screen recording (.mp4, .mov) or
record your screen to clone a whole app (experimental).{" "}
<a
className="underline"
href={URLS["intro-to-video"]}
target="_blank"
>
Learn more.
</a>
</div>
)}
<ScreenRecorder
screenRecorderState={screenRecorderState}
setScreenRecorderState={setScreenRecorderState}
generateCode={setReferenceImages}
/>
</>
)}
<ScreenRecorder
screenRecorderState={screenRecorderState}
setScreenRecorderState={setScreenRecorderState}
generateCode={setReferenceImages}
/>
</section>
);
}