diff --git a/surfsense_web/components/chat-comments/comment-item/comment-item.tsx b/surfsense_web/components/chat-comments/comment-item/comment-item.tsx index cae8fc0c6..e37e17f6d 100644 --- a/surfsense_web/components/chat-comments/comment-item/comment-item.tsx +++ b/surfsense_web/components/chat-comments/comment-item/comment-item.tsx @@ -1,6 +1,8 @@ "use client"; +import { useAtom } from "jotai"; import { MessageSquare } from "lucide-react"; +import { currentUserAtom } from "@/atoms/user/user-query.atoms"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; @@ -99,8 +101,12 @@ export function CommentItem({ onReply, isReply = false, }: CommentItemProps) { - const displayName = - comment.author?.displayName || comment.author?.email.split("@")[0] || "Unknown"; + const [{ data: currentUser }] = useAtom(currentUserAtom); + + const isCurrentUser = currentUser?.id === comment.author?.id; + const displayName = isCurrentUser + ? "Me" + : comment.author?.displayName || comment.author?.email.split("@")[0] || "Unknown"; const email = comment.author?.email || ""; return ( diff --git a/surfsense_web/components/chat-comments/comment-thread/comment-thread.tsx b/surfsense_web/components/chat-comments/comment-thread/comment-thread.tsx index c56dca6c8..1b507b176 100644 --- a/surfsense_web/components/chat-comments/comment-thread/comment-thread.tsx +++ b/surfsense_web/components/chat-comments/comment-thread/comment-thread.tsx @@ -86,7 +86,7 @@ export function CommentThread({ {/* Reply items */} {showReplies && hasReplies && ( -