Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(notifications): use fallback display name for null video names in first-view email

Richie McIlroyf3530e7767a3
diff --git a/apps/web/lib/Notification.ts b/apps/web/lib/Notification.ts
index 64e8c0e53..55b4c1916 100644
--- a/apps/web/lib/Notification.ts
+++ b/apps/web/lib/Notification.ts
@@ -376,13 +376,15 @@ export async function sendFirstViewEmail(
? `https://cap.link/${params.videoId}`
: `${serverEnv().WEB_URL}/s/${params.videoId}`;
+ const displayName = videoWithOwner.videoName || "Untitled Video";
+
await sendEmail({
email: videoWithOwner.ownerEmail,
- subject: `Your Cap "${videoWithOwner.videoName}" just got its first view!`,
+ subject: `Your Cap "${displayName}" just got its first view!`,
react: FirstView({
email: videoWithOwner.ownerEmail,
url: videoUrl,
- videoName: videoWithOwner.videoName,
+ videoName: displayName,
viewerName,
}),
});