Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(web): handle array videoId param and use safer array access in AuthOverlay

Richie McIlroya440a325e2cf
diff --git a/apps/web/app/s/[videoId]/_components/AuthOverlay.tsx b/apps/web/app/s/[videoId]/_components/AuthOverlay.tsx
index 05bf758aa..75a3c8340 100644
--- a/apps/web/app/s/[videoId]/_components/AuthOverlay.tsx
+++ b/apps/web/app/s/[videoId]/_components/AuthOverlay.tsx
@@ -135,7 +135,8 @@ const StepOne = ({
setLastResendTime: (time: number | null) => void;
emailId: string;
}) => {
- const videoId = useParams().videoId;
+ const rawVideoId = useParams().videoId;
+ const videoId = Array.isArray(rawVideoId) ? rawVideoId[0] : rawVideoId;
const handleGoogleSignIn = () => {
trackEvent("auth_started", {
method: "google",
@@ -179,7 +180,7 @@ const StepOne = ({
method: "email",
is_signup: false,
auth_surface: "share_overlay",
- email_domain: normalizedEmail.split("@")[1],
+ email_domain: normalizedEmail.split("@").at(1),
video_id: videoId,
});
toast.success("Email sent - check your inbox!");