From ab8baca1aba5548309017aecd7b9ccc12369c462 Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Mon, 25 Mar 2024 15:31:24 -0400 Subject: [PATCH] disable better error message for videos on hosted version --- frontend/src/components/ImageUpload.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/src/components/ImageUpload.tsx b/frontend/src/components/ImageUpload.tsx index 8573824..c598ee0 100644 --- a/frontend/src/components/ImageUpload.tsx +++ b/frontend/src/components/ImageUpload.tsx @@ -8,6 +8,7 @@ import { Badge } from "./ui/badge"; import ScreenRecorder from "./recording/ScreenRecorder"; import { ScreenRecorderState } from "../types"; import { IS_RUNNING_ON_CLOUD } from "../config"; +import { addEvent } from "../lib/analytics"; const baseStyle = { flex: 1, @@ -83,6 +84,17 @@ function ImageUpload({ setReferenceImages }: Props) { "video/webm": [".webm"], }, onDrop: (acceptedFiles) => { + if (IS_RUNNING_ON_CLOUD) { + const isVideo = acceptedFiles.some((file) => + file.type.startsWith("video/") + ); + if (isVideo) { + toast.error("Videos are not yet supported on the hosted version."); + addEvent("VideoUpload"); + return; + } + } + // Set up the preview thumbnail images setFiles( acceptedFiles.map((file: File) =>