Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

web: fix displaying name of video creator + pro status (#1315)

Ameer Al Ashhabb6d21f541e2b
diff --git a/apps/web/app/s/[videoId]/Share.tsx b/apps/web/app/s/[videoId]/Share.tsx
index 83f93d56a..537701d88 100644
--- a/apps/web/app/s/[videoId]/Share.tsx
+++ b/apps/web/app/s/[videoId]/Share.tsx
@@ -1,7 +1,6 @@
"use client";
-import type { userSelectProps } from "@cap/database/auth/session";
-import type { comments as commentsSchema, videos } from "@cap/database/schema";
+import type { comments as commentsSchema } from "@cap/database/schema";
import type { ImageUpload, Video } from "@cap/web-domain";
import { useQuery } from "@tanstack/react-query";
import {
diff --git a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx
index f3992bd2e..14e7f2c86 100644
--- a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx
+++ b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx
@@ -242,7 +242,7 @@ export const ShareHeader = ({
/>
)}
<div className="flex flex-col text-left">
- <p className="text-sm text-gray-12">{data.name}</p>
+ <p className="text-sm text-gray-12">{data.owner.name}</p>
<p className="text-xs text-gray-10">
{moment(data.createdAt).fromNow()}
</p>
diff --git a/apps/web/app/s/[videoId]/page.tsx b/apps/web/app/s/[videoId]/page.tsx
index 2b28b08eb..5ef313708 100644
--- a/apps/web/app/s/[videoId]/page.tsx
+++ b/apps/web/app/s/[videoId]/page.tsx
@@ -720,17 +720,19 @@ async function AuthorizedContent({
const videoWithOrganizationInfo = await Effect.gen(function* () {
const imageUploads = yield* ImageUploads;
+ const ownerIsPro = userIsPro(video.owner);
return {
...video,
owner: {
id: video.owner.id,
name: video.owner.name,
- isPro: userIsPro(video.owner),
+ isPro: ownerIsPro,
image: video.ownerImageUrlOrKey
? yield* imageUploads.resolveImageUrl(video.ownerImageUrlOrKey)
: null,
},
+ ownerIsPro,
organization: {
organizationMembers: membersList.map((member) => member.userId),
organizationId: video.sharedOrganization?.organizationId ?? undefined,