From 74b7dd09ea4e7958a571bc8514db34e7f870a9dc Mon Sep 17 00:00:00 2001 From: dwindown Date: Fri, 26 Dec 2025 09:36:54 +0700 Subject: [PATCH] Fix reviewer name priority to use live profile data first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed fallback order from: reviewer_name || profiles.name || 'Anonymous' To: profiles.name || reviewer_name || 'Anonymous' This ensures: 1. Live profile name is always shown (current data) 2. Falls back to stored reviewer_name if profile deleted 3. Shows "Anonymous" as last resort Fixes issue where name changes don't reflect on old reviews 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- src/components/reviews/ProductReviews.tsx | 2 +- src/components/reviews/TestimonialsSection.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/reviews/ProductReviews.tsx b/src/components/reviews/ProductReviews.tsx index 1c46690..d729f22 100644 --- a/src/components/reviews/ProductReviews.tsx +++ b/src/components/reviews/ProductReviews.tsx @@ -75,7 +75,7 @@ export function ProductReviews({ productId, type }: ProductReviewsProps) { rating={review.rating} title={review.title} body={review.body} - authorName={review.reviewer_name || review.profiles?.name || 'Anonymous'} + authorName={review.profiles?.name || review.reviewer_name || 'Anonymous'} date={review.created_at} /> ))} diff --git a/src/components/reviews/TestimonialsSection.tsx b/src/components/reviews/TestimonialsSection.tsx index 6e5cefb..6286eb9 100644 --- a/src/components/reviews/TestimonialsSection.tsx +++ b/src/components/reviews/TestimonialsSection.tsx @@ -46,7 +46,7 @@ export function TestimonialsSection() { rating={review.rating} title={review.title} body={review.body} - authorName={review.reviewer_name || review.profiles?.name || 'Anonymous'} + authorName={review.profiles?.name || review.reviewer_name || 'Anonymous'} date={review.created_at} /> ))}