Skip to content

Commit 06302df

Browse files
committed
fix new comment image
1 parent a9b12c7 commit 06302df

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

apps/web/actions/videos/new-comment.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { db } from "@cap/database";
44
import { getCurrentUser } from "@cap/database/auth/session";
55
import { nanoId } from "@cap/database/helpers";
66
import { comments } from "@cap/database/schema";
7+
import type { ImageUpload } from "@cap/web-domain";
78
import { Comment, type Video } from "@cap/web-domain";
89
import { revalidatePath } from "next/cache";
910
import { createNotification } from "@/lib/Notification";
@@ -12,6 +13,7 @@ export async function newComment(data: {
1213
content: string;
1314
videoId: Video.VideoId;
1415
type: "text" | "emoji";
16+
authorImage: ImageUpload.ImageUrl | null;
1517
parentCommentId: Comment.CommentId;
1618
timestamp: number;
1719
}) {
@@ -67,7 +69,7 @@ export async function newComment(data: {
6769
const commentWithAuthor = {
6870
...newComment,
6971
authorName: user.name,
70-
authorImageUrlOrKey: user.image ?? null,
72+
authorImage: data.authorImage,
7173
sending: false,
7274
};
7375

apps/web/app/s/[videoId]/_components/ShareHeader.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,14 @@ export const ShareHeader = ({
238238
</div>
239239
<div className="flex gap-7 items-center">
240240
<div className="flex gap-2 items-center">
241-
<SignedImageUrl
242-
name={data.ownerName ?? "User"}
243-
image={data.ownerImage}
244-
className="size-8"
245-
letterClass="text-base"
246-
/>
241+
{data.ownerName && (
242+
<SignedImageUrl
243+
name={data.ownerName}
244+
image={data.ownerImage}
245+
className="size-8"
246+
letterClass="text-base"
247+
/>
248+
)}
247249
<div className="flex flex-col text-left">
248250
<p className="text-sm text-gray-12">{data.ownerName}</p>
249251
<p className="text-xs text-gray-10">

apps/web/app/s/[videoId]/_components/tabs/Activity/Comments.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export const Comments = Object.assign(
109109
const data = await newComment({
110110
content,
111111
videoId: props.videoId,
112+
authorImage: user.imageUrl,
112113
parentCommentId: Comment.CommentId.make(""),
113114
type: "text",
114115
timestamp: currentTime,

0 commit comments

Comments
 (0)