File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
app/s/[videoId]/_components Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { db } from "@cap/database";
44import { getCurrentUser } from "@cap/database/auth/session" ;
55import { nanoId } from "@cap/database/helpers" ;
66import { comments } from "@cap/database/schema" ;
7+ import type { ImageUpload } from "@cap/web-domain" ;
78import { Comment , type Video } from "@cap/web-domain" ;
89import { revalidatePath } from "next/cache" ;
910import { 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
Original file line number Diff line number Diff 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" >
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments